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

View File

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