Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into greenkeeper/ethereumjs-common-0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 committed Aug 29, 2018
2 parents b5687f5 + b8f3ed8 commit 5f8eaa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,10 @@ Blockchain.prototype._iterator = function (name, func, cb) {
blockNumber.iaddn(1)
} else {
blockNumber = false
// No more blocks, return
if (err instanceof levelup.errors.NotFoundError) {
return cb2()
}
}
cb2(err)
})
Expand Down
5 changes: 3 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const BN = require('bn.js')
const rlp = ethUtil.rlp

test('blockchain test', function (t) {
t.plan(72)
t.plan(73)
var blockchain = new Blockchain()
var genesisBlock
var blocks = []
Expand Down Expand Up @@ -253,7 +253,8 @@ test('blockchain test', function (t) {
blockchain.iterator('test', function () {
t.ok(false, 'should not call iterator function')
done()
}, function () {
}, function (err) {
t.error(err, 'should not return error')
t.ok(true, 'should finish iterating')
done()
})
Expand Down

0 comments on commit 5f8eaa0

Please sign in to comment.