paypro: differentiate safeUnspent and unspent.

This commit is contained in:
Christopher Jeffrey 2014-08-13 20:21:27 -04:00 committed by Manuel Araoz
parent 324dfbc36a
commit 685c6e54dc
1 changed files with 4 additions and 4 deletions

View File

@ -113,7 +113,7 @@ Wallet.prototype.unlock = function() {
Wallet.prototype.checkAndLock = function() {
if (this.getLock()) {
return true;
}
}
this.setLock();
return false;
@ -927,16 +927,16 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) {
raw: pr.serialize().toString('hex')
};
return this.getUnspent(function(err, unspent) {
return this.getUnspent(function(err, safeUnspent, unspent) {
if (options.fetch) {
if (!unspent || !unspent.length) {
return cb(new Error('No unspent outputs available.'));
}
self.createPaymentTxSync(options, merchantData, unspent);
self.createPaymentTxSync(options, merchantData, safeUnspent);
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);