From 64b5f731a8f3bcb4e6b1d4f3804d3d394f05b188 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 23 Feb 2016 00:38:32 -0800 Subject: [PATCH] even more fixes. --- lib/bcoin/blockdb.js | 2 +- lib/bcoin/http.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/blockdb.js b/lib/bcoin/blockdb.js index 6be4e37a..1d837832 100644 --- a/lib/bcoin/blockdb.js +++ b/lib/bcoin/blockdb.js @@ -855,7 +855,7 @@ BlockDB.prototype.getBlock = function getBlock(hash, callback) { if (data) { try { - block = self.parse.parseBlock(data); + block = self.parser.parseBlock(data); block = new bcoin.block(block, 'block'); } catch (e) { return callback(e); diff --git a/lib/bcoin/http.js b/lib/bcoin/http.js index 01a50113..1a2c8df1 100644 --- a/lib/bcoin/http.js +++ b/lib/bcoin/http.js @@ -255,9 +255,12 @@ HTTPServer.prototype._initRouter = function _initRouter() { if (!routes) return done(new Error('No routes found.')); - (function next() { + (function next(err) { var route, path, callback, compiled, matched; + if (err) + return done(err); + if (i === routes.length) return done(new Error('Route not found.'));