From 4984d81284384742799bc53aa3b0a7149e831e5a Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 20 Nov 2014 16:26:15 -0300 Subject: [PATCH] serialize only the list of selected utxos, if available --- lib/TransactionBuilder.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/TransactionBuilder.js b/lib/TransactionBuilder.js index fb50d48..b1f1ca6 100644 --- a/lib/TransactionBuilder.js +++ b/lib/TransactionBuilder.js @@ -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, };