Skip to content

Commit

Permalink
Merge pull request #3 from neo-project/master
Browse files Browse the repository at this point in the history
Fix GetTransactionFromBlock Syscall (neo-project#1170)
  • Loading branch information
Qiao-Jin committed Oct 23, 2019
2 parents 36c1d16 + e53f533 commit a1af198
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 a1af198

Please sign in to comment.