simplify returnData logic
This commit is contained in:
parent
22dff9ff88
commit
109f841a9e
|
@ -293,14 +293,9 @@ proc addChildComputation*(c, child: Computation) =
|
|||
child.vmState.touchedAccounts.incl child.msg.contractAddress
|
||||
|
||||
if child.isError:
|
||||
if child.shouldBurnGas:
|
||||
c.returnData = @[]
|
||||
else:
|
||||
c.returnData = child.output
|
||||
else:
|
||||
if child.msg.isCreate:
|
||||
c.returnData = @[]
|
||||
else:
|
||||
if not child.msg.isCreate:
|
||||
c.returnData = child.output
|
||||
child.touchedAccounts.incl child.msg.contractAddress
|
||||
c.logEntries.add child.logEntries
|
||||
|
|
|
@ -561,6 +561,7 @@ proc canTransfer(c: Computation, memPos, memLen: int, value: Uint256, opCode: st
|
|||
|
||||
c.gasMeter.consumeGas(gasCost, reason = reason)
|
||||
c.memory.extend(memPos, memLen)
|
||||
c.returnData.setLen(0)
|
||||
|
||||
# the sender is childmsg sender, not parent msg sender
|
||||
# perhaps we need to move this code somewhere else
|
||||
|
|
Loading…
Reference in New Issue