Skip to content

Commit

Permalink
Merge pull request #422 from ethereumjs/fix/cache-flush-sync
Browse files Browse the repository at this point in the history
Fix mixed sync/async funcs in cache
  • Loading branch information
holgerd77 committed Jan 22, 2019
2 parents 09b8bfb + 04b2bc7 commit 0d965b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Cache.prototype.getOrLoad = function (key, cb) {
var self = this
var account = this.lookup(key)
if (account) {
cb(null, account)
async.nextTick(cb, null, account)
} else {
self._lookupAccount(key, function (err, account) {
if (err) return cb(err)
Expand Down Expand Up @@ -102,7 +102,7 @@ Cache.prototype.flush = function (cb) {
} else {
next = it.hasNext
it.next()
done()
async.nextTick(done)
}
}, cb)
}
Expand Down

0 comments on commit 0d965b1

Please sign in to comment.