Skip to content

Commit

Permalink
Merge pull request #392 from ethereumjs/reset-selfdestruct-on-revert
Browse files Browse the repository at this point in the history
Reset selfdestruct on revert
  • Loading branch information
holgerd77 authored Nov 16, 2018
2 parents 839417d + 70dd74a commit db3db1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/opFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,13 @@ function checkOutOfGas (runState, callOptions) {

// sets up and calls runCall
function makeCall (runState, callOptions, localOpts, cb) {
var selfdestruct = Object.assign({}, runState.selfdestruct)
callOptions.caller = callOptions.caller || runState.address
callOptions.origin = runState.origin
callOptions.gasPrice = runState.gasPrice
callOptions.block = runState.block
callOptions.static = callOptions.static || false
callOptions.selfdestruct = runState.selfdestruct
callOptions.selfdestruct = selfdestruct
callOptions.storageReader = runState.storageReader

// increment the runState.depth
Expand Down Expand Up @@ -1053,6 +1054,7 @@ function makeCall (runState, callOptions, localOpts, cb) {
}

if (!results.vm.exceptionError) {
Object.assign(runState.selfdestruct, selfdestruct)
// update stateRoot on current contract
runState.stateManager.getAccount(runState.address, function (err, account) {
if (err) return cb(err)
Expand Down

0 comments on commit db3db1c

Please sign in to comment.