From c1cebf18d5a5f901542c509fceb0e245867f8029 Mon Sep 17 00:00:00 2001 From: erikzhang Date: Tue, 2 Apr 2019 18:02:12 +0800 Subject: [PATCH] fixes `gas_consumed` --- neo/SmartContract/ApplicationEngine.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neo/SmartContract/ApplicationEngine.cs b/neo/SmartContract/ApplicationEngine.cs index 81606438ed..8eedc84c87 100644 --- a/neo/SmartContract/ApplicationEngine.cs +++ b/neo/SmartContract/ApplicationEngine.cs @@ -132,6 +132,8 @@ protected virtual long GetPriceForSysCall() protected override bool PreExecuteInstruction() { + if (CurrentContext.InstructionPointer >= CurrentContext.Script.Length) + return true; gas_consumed = checked(gas_consumed + GetPrice() * ratio); if (!testMode && gas_consumed > gas_amount) return false; if (!CheckDynamicInvoke()) return false;