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);