fix unspent property.

This commit is contained in:
Christopher Jeffrey 2016-01-18 12:47:32 -08:00
parent 1d5e3ca27e
commit 220b09bc67

View File

@ -61,6 +61,7 @@ function TX(data, block) {
}
}
this._unspent = data._unspent || null;
this.hardFee = data.hardFee || null;
this.changeAddress = data.changeAddress || null;
this.changeIndex = data.changeIndex != null ? data.changeIndex : -1;
@ -948,7 +949,7 @@ TX.prototype.fillUnspent = function fillUnspent(unspent, address, fee) {
var result;
if (unspent)
this.unspent = unspent;
this._unspent = unspent;
if (address)
this.changeAddress = address;
@ -958,7 +959,7 @@ TX.prototype.fillUnspent = function fillUnspent(unspent, address, fee) {
assert(this.changeAddress);
result = this.getUnspent(this.unspent, this.changeAddress, this.hardFee);
result = this.getUnspent(this._unspent, this.changeAddress, this.hardFee);
if (!result.inputs)
return result;
@ -1371,6 +1372,7 @@ TX.prototype.inspect = function inspect() {
copy.block = this.block;
delete copy._raw;
delete copy._chain;
delete copy._unspent;
copy.hash = this.hash('hex');
copy.rhash = this.rhash;
copy.rblock = this.rblock;