fix block 299804 problem

This commit is contained in:
andri lim 2019-02-25 17:03:43 +07:00
parent 230e1d6fd0
commit 3dd18bd8ec
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 8 additions and 3 deletions

View File

@ -182,7 +182,7 @@ proc applyMessage(computation: var BaseComputation, opCode: static[Op]) =
debug "applyMessageAux failed", msg = computation.error.info
return
if computation.gasMeter.gasRemaining <= 0:
if computation.gasMeter.gasRemaining < 0:
snapshot.commit()
return

View File

@ -700,6 +700,9 @@ template genCall(callName: untyped, opCode: Op): untyped =
else:
(memOutPos, memOutLen)
if gas > high(GasInt).u256:
raise newException(TypeError, "GasInt Overflow (" & callName.astToStr & ")")
let (childGasFee, childGasLimit) = computation.gasCosts[opCode].c_handler(
value,
GasParams(kind: Call,
@ -742,8 +745,10 @@ template genCall(callName: untyped, opCode: Op): untyped =
if sender != ZERO_ADDRESS:
childMsg.sender = sender
if opCode == CallCode:
else:
childMsg.sender = computation.msg.storageAddress
if opCode == CallCode:
childMsg.storageAddress = computation.msg.storageAddress
var childComputation = applyChildComputation(computation, childMsg, opCode)