diff --git a/neo/SmartContract/InteropService.cs b/neo/SmartContract/InteropService.cs index c647cb84fc..eed16fe17a 100644 --- a/neo/SmartContract/InteropService.cs +++ b/neo/SmartContract/InteropService.cs @@ -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; }