paypro: differentiate safeUnspent and unspent.

This commit is contained in:
Christopher Jeffrey 2014-08-13 20:21:27 -04:00 committed by Manuel Araoz
commit 685c6e54dc

View file

@ -927,16 +927,16 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) {
raw: pr.serialize().toString('hex') raw: pr.serialize().toString('hex')
}; };
return this.getUnspent(function(err, unspent) { return this.getUnspent(function(err, safeUnspent, unspent) {
if (options.fetch) { if (options.fetch) {
if (!unspent || !unspent.length) { if (!unspent || !unspent.length) {
return cb(new Error('No unspent outputs available.')); return cb(new Error('No unspent outputs available.'));
} }
self.createPaymentTxSync(options, merchantData, unspent); self.createPaymentTxSync(options, merchantData, safeUnspent);
return cb(null, merchantData, pr); return cb(null, merchantData, pr);
} }
var ntxid = self.createPaymentTxSync(options, merchantData, unspent); var ntxid = self.createPaymentTxSync(options, merchantData, safeUnspent);
if (ntxid) { if (ntxid) {
self.sendIndexes(); self.sendIndexes();
self.sendTxProposal(ntxid); self.sendTxProposal(ntxid);