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