From d6e7ca0660c62f16ccdedd3380e2206b533f05ed Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 28 Feb 2016 12:11:49 -0800 Subject: [PATCH] minor fixes. --- lib/bcoin/block.js | 2 ++ lib/bcoin/chain.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/block.js b/lib/bcoin/block.js index 76655bbe..118581e3 100644 --- a/lib/bcoin/block.js +++ b/lib/bcoin/block.js @@ -46,6 +46,8 @@ Block.prototype.render = function render() { }; Block.prototype.renderNormal = function renderNormal() { + this.getRaw(); + if (!this._witnessSize) return this._raw; diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index 6bdfa4e5..367cafdf 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -355,7 +355,7 @@ Chain.prototype._preload = function _preload(callback) { if (lastEntry && entry.prevBlock !== lastEntry.hash) { start = Math.max(0, height - 2); stream.destroy(); - self.resetHeightAsync(start, function(e) { + return self.resetHeightAsync(start, function(e) { if (e) throw e; return callback(new Error('Corrupt headers.'), start + 1); @@ -367,7 +367,7 @@ Chain.prototype._preload = function _preload(callback) { if (!block.verifyHeaders()) { start = Math.max(0, height - 2); stream.destroy(); - self.resetHeightAsync(start, function(e) { + return self.resetHeightAsync(start, function(e) { if (e) throw e; return callback(new Error('Bad headers.'), start + 1);