From 2ceb57a60f9af46137c140d77552ff31f681398b Mon Sep 17 00:00:00 2001 From: Shargon Date: Mon, 21 Oct 2019 11:49:46 +0200 Subject: [PATCH 1/2] Fix Syscall --- neo/SmartContract/InteropService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neo/SmartContract/InteropService.cs b/neo/SmartContract/InteropService.cs index c647cb84fc..693c68f3c1 100644 --- a/neo/SmartContract/InteropService.cs +++ b/neo/SmartContract/InteropService.cs @@ -411,11 +411,11 @@ private static bool Blockchain_GetTransactionFromBlock(ApplicationEngine engine) int index = (int)engine.CurrentContext.EvaluationStack.Pop().GetBigInteger(); if (index < 0 || index >= block.Hashes.Length) 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; } From b3b5267ac029d030a31e0110facd7b93419e49d5 Mon Sep 17 00:00:00 2001 From: Shargon Date: Tue, 22 Oct 2019 11:53:51 +0200 Subject: [PATCH 2/2] Fix --- neo/SmartContract/InteropService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/SmartContract/InteropService.cs b/neo/SmartContract/InteropService.cs index 693c68f3c1..eed16fe17a 100644 --- a/neo/SmartContract/InteropService.cs +++ b/neo/SmartContract/InteropService.cs @@ -409,7 +409,7 @@ 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 + 1]); if (tx == null)