Skip to content

Commit

Permalink
Clean-up state-manager.touched
Browse files Browse the repository at this point in the history
Made _putAccount public
  • Loading branch information
mattdean-digicatapult committed Mar 14, 2018
1 parent 995b035 commit 62f0d19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/runCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ module.exports = function (opts, cb) {
// add the amount sent to the `to` account
var newBalance = new BN(toAccount.balance).add(txValue)
toAccount.balance = newBalance
// _putAccount as the nonce may have changed for contract creation
stateManager._putAccount(ethUtil.toBuffer(toAddress), toAccount, cb)
// putAccount as the nonce may have changed for contract creation
stateManager.putAccount(ethUtil.toBuffer(toAddress), toAccount, cb)
}

function loadCode (cb) {
Expand Down
8 changes: 4 additions & 4 deletions lib/stateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ proto.exists = function (address, cb) {
}

// saves the account
proto._putAccount = function (address, account, cb) {
proto.putAccount = function (address, account, cb) {
var self = this
// TODO: dont save newly created accounts that have no balance
// if (toAccount.balance.toString('hex') === '00') {
Expand Down Expand Up @@ -81,7 +81,7 @@ proto.putAccountBalance = function (address, balance, cb) {
}

account.balance = balance
self._putAccount(address, account, cb)
self.putAccount(address, account, cb)
})
}

Expand All @@ -97,7 +97,7 @@ proto.putContractCode = function (address, value, cb) {
if (err) {
return cb(err)
}
self._putAccount(address, account, cb)
self.putAccount(address, account, cb)
})
})
}
Expand Down Expand Up @@ -179,7 +179,7 @@ proto.putContractStorage = function (address, key, value, cb) {
// update contract stateRoot
var contract = self.cache.get(address)
contract.stateRoot = storageTrie.root
self._putAccount(address, contract, cb)
self.putAccount(address, contract, cb)
self._touched.add(address.toString('hex'))
}
})
Expand Down

0 comments on commit 62f0d19

Please sign in to comment.