minor optimizations.
This commit is contained in:
parent
7862418ccc
commit
c3774261b4
@ -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())
|
||||
|
||||
@ -1892,7 +1892,7 @@ NetworkAddress.prototype.fromOptions = function fromOptions(options) {
|
||||
};
|
||||
|
||||
NetworkAddress.fromOptions = function fromOptions(options) {
|
||||
return NetworkAddress().fromOptions(options);
|
||||
return new NetworkAddress().fromOptions(options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user