mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #1093 from chjj/paypro
paypro: fix - use safeUnspent for createPaymentTxSync.
This commit is contained in:
commit
3ab28b61e4
|
@ -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 = [];
|
||||
|
|
Loading…
Reference in New Issue