minor fixes.

This commit is contained in:
Christopher Jeffrey 2016-02-28 12:11:49 -08:00
parent 85dd0aa3a2
commit d6e7ca0660
2 changed files with 4 additions and 2 deletions

View File

@ -46,6 +46,8 @@ Block.prototype.render = function render() {
};
Block.prototype.renderNormal = function renderNormal() {
this.getRaw();
if (!this._witnessSize)
return this._raw;

View File

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