From 5d3f3f60feca8354cc33a920a4db30a6cf97ed4b Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 14 Aug 2014 13:10:31 -0400 Subject: [PATCH] paypro: fix - use safeUnspent for createPaymentTxSync. --- js/models/core/Wallet.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index e1cf67666..81dda34f5 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -933,7 +933,7 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) { return cb(new Error('No unspent outputs available.')); } try { - self.createPaymentTxSync(options, merchantData, unspent); + self.createPaymentTxSync(options, merchantData, safeUnspent); } catch (e) { var msg = e.message || ''; if (msg.indexOf('not enough unspent tx outputs to fulfill')) { @@ -946,7 +946,7 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) { return cb(null, merchantData, pr); } - var ntxid = self.createPaymentTxSync(options, merchantData, unspent); + var ntxid = self.createPaymentTxSync(options, merchantData, safeUnspent); if (ntxid) { self.sendIndexes(); self.sendTxProposal(ntxid); @@ -1137,6 +1137,14 @@ Wallet.prototype.createPaymentTxSync = function(options, merchantData, unspent) } }; + if (typeof opts.spendUnconfirmed === 'undefined') { + opts.spendUnconfirmed = this.spendUnconfirmed; + } + + for (var k in Wallet.builderOpts) { + opts[k] = Wallet.builderOpts[k]; + } + merchantData.total = bignum(merchantData.total, 10); var outs = [];