diff --git a/lib/bcoin/block.js b/lib/bcoin/block.js index 8e9b33c7..a3c36cae 100644 --- a/lib/bcoin/block.js +++ b/lib/bcoin/block.js @@ -235,8 +235,8 @@ Block.prototype.getBaseSize = function getBaseSize() { Block.prototype.hasWitness = function hasWitness() { var i; - if (this._witnessSize > 0) - return true; + if (this._witnessSize != null) + return this._witnessSize !== 0; for (i = 0; i < this.txs.length; i++) { if (this.txs[i].hasWitness()) diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index fcd69bad..cf0684f8 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -1892,7 +1892,7 @@ NetworkAddress.prototype.fromOptions = function fromOptions(options) { }; NetworkAddress.fromOptions = function fromOptions(options) { - return NetworkAddress().fromOptions(options); + return new NetworkAddress().fromOptions(options); }; /** diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index 38b69342..123fda52 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -399,8 +399,8 @@ TX.prototype.getBaseSize = function getBaseSize() { TX.prototype.hasWitness = function hasWitness() { var i; - if (this._witnessSize > 0) - return true; + if (this._witnessSize != null) + return this._witnessSize !== 0; for (i = 0; i < this.inputs.length; i++) { if (this.inputs[i].witness.items.length > 0)