Skip to content

Commit

Permalink
Fix nep-5 transferation (#960)
Browse files Browse the repository at this point in the history
* Fix nep-5 transferation

Multi addresses in a wallet, when transfer the whole nep-5 from one address, if other address don't have this asset, it'll return "Insuffient funds". This fix is able to solve this issue.

* Optimization
  • Loading branch information
superboyiii authored and shargon committed Jul 28, 2019
1 parent 65fe1b2 commit be17769
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion neo/Wallets/Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ public Transaction MakeTransaction(List<TransactionAttribute> attributes, IEnume
}
ApplicationEngine engine = ApplicationEngine.Run(script);
if (engine.State.HasFlag(VMState.FAULT)) return null;
balances.Add((account, engine.ResultStack.Pop().GetBigInteger()));
var result = engine.ResultStack.Pop().GetBigInteger();
if (result == 0) continue;
balances.Add((account, result));
}
BigInteger sum = balances.Aggregate(BigInteger.Zero, (x, y) => x + y.Value);
if (sum < output.Value) return null;
Expand Down

0 comments on commit be17769

Please sign in to comment.