serialize only the list of selected utxos, if available

This commit is contained in:
Matias Alejo Garcia 2014-11-20 16:26:15 -03:00
parent 8c423d5cf1
commit 4984d81284

View File

@ -821,10 +821,12 @@ TransactionBuilder.prototype.build = function() {
//
TransactionBuilder.prototype.toObj = function() {
var utxos = this.selectedUtxos && this.selectedUtxos[0] ? this.selectedUtxos : JSON.parse(this.vanilla.utxos);
var ret = {
version: TOOBJ_VERSION,
outs: JSON.parse(this.vanilla.outs),
utxos: JSON.parse(this.vanilla.utxos),
utxos: utxos,
opts: JSON.parse(this.vanilla.opts),
scriptSig: this.vanilla.scriptSig,
};