示例#1
0
        private void RejectTransaction(AcceptTransationAction action)
        {
            var involvedParties = action.Model.Transfers
                                  .SelectMany(x => new[] { x.GiverId, x.ReceiverId })
                                  .Distinct()
                                  .ToList();

            involvedParties.ForEach(ip => _actor.Account.DecreaseTrust(ip, UnaccountedTransactionDistrustFactor));
        }
示例#2
0
 private void AccountTransaction(AcceptTransationAction action)
 {
     foreach (var transfer in action.Model.Transfers)
     {
         AccountTransfer(transfer);
     }
     if (_actor.Account.HasPendingTransaction(action.Model.Key))
     {
         _actor.RelayTransactionAccepted(action.Model);
     }
 }
示例#3
0
 private void WhenAcceptTransaction(AcceptTransationAction action)
 {
     if (_actor.Account.HasReceivedTransaction(action.Model.Key))
     {
         return;
     }
     _actor.Account.AddReceivedTransaction(action.Model.Key);
     if (_actor.VerifyTransaction(action.Model))
     {
         AccountTransaction(action);
     }
     else
     {
         RejectTransaction(action);
     }
 }