diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index 453d8e1c..708bfd8f 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -1883,7 +1883,7 @@ Chain.prototype.getTarget = function getTarget(block, prev, ancestors) { assert(first); - this.retarget(prev, first); + return this.retarget(prev, first); }; /** @@ -2029,7 +2029,7 @@ Chain.prototype.getState = function getState(prev, id, callback) { if (stateCache[entry.hash] != null) return walkForward(stateCache[entry.hash]); - return entry.getMedianTimeAsync(function(err, medianTime) { + entry.getMedianTimeAsync(function(err, medianTime) { if (err) return walk(err); @@ -2040,7 +2040,7 @@ Chain.prototype.getState = function getState(prev, id, callback) { height = entry.height - period; - return entry.getAncestorByHeight(height, walk); + entry.getAncestorByHeight(height, walk); }); })(null, prev); @@ -2120,9 +2120,10 @@ Chain.prototype.getState = function getState(prev, id, callback) { case constants.thresholdStates.ACTIVE: stateCache[entry.hash] = state; return walkForward(state); + default: + assert(false, 'Bad state.'); + break; } - - assert(false, 'Bad state.'); } };