Merge branch 'jangko-fix_maxcalldepth'
This commit is contained in:
commit
7b26bf1cee
|
@ -144,7 +144,7 @@ proc writeContract*(computation: var BaseComputation, fork: Fork): bool =
|
||||||
result = false
|
result = false
|
||||||
|
|
||||||
proc transferBalance(computation: var BaseComputation, opCode: static[Op]): bool =
|
proc transferBalance(computation: var BaseComputation, opCode: static[Op]): bool =
|
||||||
if computation.msg.depth >= MaxCallDepth:
|
if computation.msg.depth > MaxCallDepth:
|
||||||
debug "Stack depth limit reached", depth=computation.msg.depth
|
debug "Stack depth limit reached", depth=computation.msg.depth
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
|
@ -528,7 +528,10 @@ proc canTransfer(computation: BaseComputation, memPos, memLen: int, value: Uint2
|
||||||
debug "Computation Failure", reason = "Insufficient funds available to transfer", required = computation.msg.value, balance = senderBalance
|
debug "Computation Failure", reason = "Insufficient funds available to transfer", required = computation.msg.value, balance = senderBalance
|
||||||
return false
|
return false
|
||||||
|
|
||||||
if computation.msg.depth >= MaxCallDepth:
|
# unlike the other MaxCallDepth comparison,
|
||||||
|
# this one has not been entered child computation
|
||||||
|
# thats why it has `+ 1`
|
||||||
|
if computation.msg.depth + 1 > MaxCallDepth:
|
||||||
debug "Computation Failure", reason = "Stack too deep", maximumDepth = MaxCallDepth, depth = computation.msg.depth
|
debug "Computation Failure", reason = "Stack too deep", maximumDepth = MaxCallDepth, depth = computation.msg.depth
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue