From 34fd831d6fd2902a674cef6d5ce6003c8159824d Mon Sep 17 00:00:00 2001 From: andri lim Date: Wed, 10 Apr 2019 10:11:25 +0700 Subject: [PATCH] fix block 2283416 problem --- nimbus/vm/computation.nim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nimbus/vm/computation.nim b/nimbus/vm/computation.nim index 839bfb656..6dcb2bfc5 100644 --- a/nimbus/vm/computation.nim +++ b/nimbus/vm/computation.nim @@ -154,10 +154,6 @@ proc writeContract*(computation: BaseComputation, fork: Fork): bool = result = false proc transferBalance(computation: BaseComputation, opCode: static[Op]) = - if computation.msg.depth > MaxCallDepth: - computation.setError(&"Stack depth limit reached depth={computation.msg.depth}") - return - let senderBalance = computation.vmState.readOnlyStateDb(). getBalance(computation.msg.sender) @@ -193,6 +189,11 @@ proc postExecuteVM(computation: BaseComputation) = proc executeOpcodes*(computation: BaseComputation) {.gcsafe.} proc applyMessage*(computation: BaseComputation, opCode: static[Op]) = + if computation.msg.depth > MaxCallDepth: + computation.setError(&"Stack depth limit reached depth={computation.msg.depth}") + computation.nextProc() + return + computation.snapshot() defer: computation.dispose()