Skip to content

Commit

Permalink
Fix GetTransactionFromBlock Syscall (neo-project#1170)
Browse files Browse the repository at this point in the history
* Fix Syscall

* Fix
  • Loading branch information
shargon authored and Tommo-L committed Jun 22, 2020
1 parent e91c587 commit 24f76ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions neo/SmartContract/InteropService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,13 @@ private static bool Blockchain_GetTransactionFromBlock(ApplicationEngine engine)
else
{
int index = (int)engine.CurrentContext.EvaluationStack.Pop().GetBigInteger();
if (index < 0 || index >= block.Hashes.Length) return false;
if (index < 0 || index >= block.Hashes.Length - 1) return false;

Transaction tx = engine.Snapshot.GetTransaction(block.Hashes[index]);
Transaction tx = engine.Snapshot.GetTransaction(block.Hashes[index + 1]);
if (tx == null)
engine.CurrentContext.EvaluationStack.Push(StackItem.Null);
else
engine.CurrentContext.EvaluationStack.Push(StackItem.FromInterface(tx));
engine.CurrentContext.EvaluationStack.Push(tx.ToStackItem());
}
return true;
}
Expand Down

0 comments on commit 24f76ea

Please sign in to comment.