diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index e89a1509..4ca925f3 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -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;