paypro: differentiate safeUnspent and unspent.
This commit is contained in:
parent
324dfbc36a
commit
685c6e54dc
1 changed files with 4 additions and 4 deletions
|
|
@ -113,7 +113,7 @@ Wallet.prototype.unlock = function() {
|
||||||
Wallet.prototype.checkAndLock = function() {
|
Wallet.prototype.checkAndLock = function() {
|
||||||
if (this.getLock()) {
|
if (this.getLock()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setLock();
|
this.setLock();
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue