Skip to content

Commit

Permalink
fix(Wallet): bind contexts
Browse files Browse the repository at this point in the history
Some methods weren't being bound, which caused problems when passing the callbacks to different contexts.
  • Loading branch information
mappum committed Jun 18, 2015
1 parent 4864dae commit 33aec0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ Wallet.prototype._update = function () {
this.chain.getBlockAtTime(this.state.createdAt - TIME_MARGIN, function (err, block) {
if (err) return self._error(err)
self.state.tip = block
self._saveState()
self._scanChain()
self._saveState(self._scanChain.bind(self))
})
return
}
Expand All @@ -201,7 +200,7 @@ Wallet.prototype._scanChain = function (opts) {
if (err) return self._error(err)

if (path.remove.length > 0) {
async.eachSeries(path.remove, self._unprocessBlock, function (err) {
async.eachSeries(path.remove, self._unprocessBlock.bind(self), function (err) {
if (err) return self._error(err)
processTransactions()
})
Expand Down

0 comments on commit 33aec0d

Please sign in to comment.