Skip to content

Commit

Permalink
Fix error propagation in runBlockchain
Browse files Browse the repository at this point in the history
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
  • Loading branch information
s1na committed Aug 29, 2018
1 parent ea29768 commit f58df6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/runBlockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ module.exports = function (blockchain, cb) {
}, function (err, results) {
if (err) {
// remove invalid block
console.log('Invalid block error:', err)
blockchain.delBlock(block.header.hash(), cb)
blockchain.delBlock(block.header.hash(), function () {
cb(err)
})
} else {
// set as new head block
headBlock = block
Expand Down

0 comments on commit f58df6b

Please sign in to comment.