diff --git a/lib/primitives/address.js b/lib/primitives/address.js index 9b3bccc2..c95f122d 100644 --- a/lib/primitives/address.js +++ b/lib/primitives/address.js @@ -138,7 +138,20 @@ Address.prototype.verifyNetwork = function verifyNetwork(network) { */ Address.prototype.isNull = function isNull() { - return util.equal(this.hash, encoding.ZERO_HASH160); + var i; + + if (this.hash.length === 20) + return util.equal(this.hash, encoding.ZERO_HASH160); + + if (this.hash.length === 32) + return util.equal(this.hash, encoding.ZERO_HASH); + + for (i = 0; i < this.hash.length; i++) { + if (this.hash[i] !== 0) + return false; + } + + return true; }; /**