From efdf8c902a255696ac734421a1c80e44d4cf760f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 15 Sep 2014 19:02:38 -0700 Subject: [PATCH] paypro: fix invalid signature error. --- js/models/core/Wallet.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 2a9faadc0..107ad366a 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -1636,12 +1636,23 @@ Wallet.prototype.receivePaymentRequestACK = function(ntxid, tx, txp, ack, cb) { var txid = tx.getHash().toString('hex'); var txHex = tx.serialize().toString('hex'); log.debug('Raw transaction: ', txHex); - log.debug('BITCOIND txid:', txid); - this.txProposals.get(ntxid).setSent(txid); - this.sendTxProposal(ntxid); - this.store(); + this.blockchain.broadcast(txHex, function(err, txid) { + log.debug('BITCOIND txid:', txid); + if (txid) { + self.txProposals.get(ntxid).setSent(txid); + self.sendTxProposal(ntxid); + self.store(); + return cb(txid, txp.merchant); + } else { + log.debug('Sent failed. Checking if the TX was sent already'); + self._checkSentTx(ntxid, function(txid) { + if (txid) + self.store(); - return cb(txid, txp.merchant); + return cb(txid, txp.merchant); + }); + } + }); }; /**