fix self destruct refund gas problem
This commit is contained in:
parent
90924eef47
commit
1ad4e256b2
|
@ -827,9 +827,6 @@ op selfDestruct, inline = false:
|
|||
|
||||
# Register the account to be deleted
|
||||
computation.registerAccountForDeletion(beneficiary)
|
||||
# FIXME: hook this into actual RefundSelfDestruct
|
||||
let RefundSelfDestruct = 24_000
|
||||
computation.gasMeter.refundGas(RefundSelfDestruct)
|
||||
|
||||
trace "SELFDESTRUCT",
|
||||
storageAddress = computation.msg.storageAddress.toHex,
|
||||
|
|
|
@ -70,8 +70,14 @@ proc execComputation*(computation: var BaseComputation): bool =
|
|||
result = computation.applyMessage(Call)
|
||||
|
||||
computation.vmState.mutateStateDB:
|
||||
var suicidedCount = 0
|
||||
for deletedAccount in computation.accountsForDeletion:
|
||||
db.deleteAccount deletedAccount
|
||||
inc suicidedCount
|
||||
|
||||
# FIXME: hook this into actual RefundSelfDestruct
|
||||
const RefundSelfDestruct = 24_000
|
||||
computation.gasMeter.refundGas(RefundSelfDestruct * suicidedCount)
|
||||
|
||||
if result:
|
||||
computation.vmState.addLogs(computation.logEntries)
|
||||
|
|
Loading…
Reference in New Issue