Skip to content

Commit

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

* Fix
  • Loading branch information
shargon committed Oct 22, 2019
1 parent 4112df2 commit e53f533
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 e53f533

Please sign in to comment.