Skip to content

Commit

Permalink
fixes gas_consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Apr 2, 2019
1 parent d7e20a4 commit c1cebf1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions neo/SmartContract/ApplicationEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c1cebf1

Please sign in to comment.