Skip to content

Commit

Permalink
Merge branch 'master-2.x' into Fix-Nep5Tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho authored Jan 7, 2020
2 parents 9291a02 + ccc5d04 commit 98dfbf1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions RpcNep5Tracker/RpcNep5Tracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,13 @@ public void OnPersist(Snapshot snapshot, IReadOnlyList<Blockchain.ApplicationExe
script = sb.ToArray();
}

ApplicationEngine engine = ApplicationEngine.Run(script, snapshot, extraGAS: maxGas);
if (engine.State.HasFlag(VMState.FAULT)) continue;
if (engine.ResultStack.Count <= 0) continue;
nep5BalancePair.Value.Balance = engine.ResultStack.Pop().GetBigInteger();
using (ApplicationEngine engine = ApplicationEngine.Run(script, snapshot, extraGAS: maxGas))
{
if (engine.State.HasFlag(VMState.FAULT)) continue;
if (engine.ResultStack.Count <= 0) continue;
nep5BalancePair.Value.Balance = engine.ResultStack.Pop().GetBigInteger();
}

nep5BalancePair.Value.LastUpdatedBlock = snapshot.Height;
if (nep5BalancePair.Value.Balance == 0)
{
Expand Down

0 comments on commit 98dfbf1

Please sign in to comment.