From cfee08d58ee7e8cadbca92368b44923d47b48b67 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 9 Aug 2016 21:14:30 -0700 Subject: [PATCH] rpc: fix findFork. --- lib/bcoin/http/rpc.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/bcoin/http/rpc.js b/lib/bcoin/http/rpc.js index 67a45ef5..0d097a9a 100644 --- a/lib/bcoin/http/rpc.js +++ b/lib/bcoin/http/rpc.js @@ -986,6 +986,12 @@ RPC.prototype.getchaintips = function getchaintips(args, callback) { RPC.prototype._findFork = function _findFork(entry, callback) { (function next(err, entry) { + if (err) + return callback(err); + + if (!entry) + return callback(new Error('Fork not found.')); + entry.isMainChain(function(err, main) { if (err) return callback(err);