Skip to content

Commit

Permalink
Merge pull request #157 from cdetrio/fix-cache-del
Browse files Browse the repository at this point in the history
null address check before deleting account from trie
  • Loading branch information
wanderer committed Jul 28, 2017
2 parents 9fc6e38 + 09e1365 commit 6a60906
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/runTx.js
Expand Up @@ -71,10 +71,12 @@ module.exports = function (opts, cb) {
function populateCache (cb) {
var accounts = new Set()
accounts.add(tx.from.toString('hex'))
accounts.add(tx.to.toString('hex'))
accounts.add(block.header.coinbase.toString('hex'))

self.stateManager.touched.push(tx.to)
if (tx.to.toString('hex') !== '') {
accounts.add(tx.to.toString('hex'))
self.stateManager.touched.push(tx.to)
}

if (opts.populateCache === false) {
return cb()
Expand Down

0 comments on commit 6a60906

Please sign in to comment.