paypro: deal with no unspent outputs. see #1043.

This commit is contained in:
Christopher Jeffrey 2014-08-05 14:36:38 -07:00 committed by Manuel Araoz
commit 0a8d734e49
2 changed files with 9 additions and 0 deletions

View file

@ -937,6 +937,9 @@ Wallet.prototype.receivePaymentRequest = function(options, pr, cb) {
return this.getUnspent(function(err, unspent) {
if (options.fetch) {
if (!unspent || !unspent.length) {
return cb(new Error('No unspent outputs.'));
}
self.createPaymentTxSync(options, merchantData, unspent);
return cb(null, merchantData, pr);
}