fix block 512335 problem

This commit is contained in:
andri lim 2019-02-25 21:18:13 +07:00
parent d679798abb
commit 9fcba8f90d
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 5 additions and 3 deletions

View File

@ -113,6 +113,8 @@ proc applyMessageAux(computation: var BaseComputation, opCode: static[Op]) =
if computation.msg.depth > STACK_DEPTH_LIMIT:
raise newException(StackDepthError, "Stack depth limit reached")
let nilai = computation.vmState.readOnlyStateDb().getBalance(computation.msg.sender)
if computation.msg.value != 0:
let senderBalance =
computation.vmState.readOnlyStateDb().
@ -174,7 +176,7 @@ proc applyMessage(computation: var BaseComputation, opCode: static[Op]) =
var snapshot = computation.snapshot()
defer: snapshot.dispose()
when opCode == Call:
when opCode in {Call, Create}:
try:
computation.applyMessageAux(opCode)
except VMError:

View File

@ -747,8 +747,8 @@ template genCall(callName: untyped, opCode: Op): untyped =
childMsg.sender = sender
else:
childMsg.sender = computation.msg.storageAddress
if opCode == CallCode:
when opCode == CallCode:
childMsg.storageAddress = computation.msg.storageAddress
var childComputation = applyChildComputation(computation, childMsg, opCode)