Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger authored and holgerd77 committed Nov 14, 2018
1 parent 3f2a7c7 commit b1482a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/opFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,29 +289,29 @@ module.exports = {
})
},
EXTCODEHASH: function (address, runState, cb) {
if (!runState._common.gteHardfork('constantinople')) {
trap(ERROR.INVALID_OPCODE)
}
var stateManager = runState.stateManager
address = addressToBuffer(address)

if (runState._precompiled[address.toString('hex')]) {
cb(null, new BN(0))
return
return cb(null, new BN(0))
}

stateManager.exists(address, function (err, exists) {
if (err) return cb(err)
if (!exists) {
cb(null, new BN(0))
return
return cb(null, new BN(0))
}

stateManager.getContractCode(address, function (err, code) {
if (err) return cb(err)
if (code.length === 0) {
cb(null, new BN(utils.KECCAK256_NULL))
return
return cb(null, new BN(utils.KECCAK256_NULL))
}

cb(null, new BN(utils.keccak256(code)))
return cb(null, new BN(utils.keccak256(code)))
})
})
},
Expand Down

0 comments on commit b1482a5

Please # to comment.