paypro: drop existing txp check.

This commit is contained in:
Christopher Jeffrey 2014-07-31 11:31:52 -07:00 committed by Manuel Araoz
parent 62fe6ce628
commit 035070b78b
1 changed files with 1 additions and 24 deletions

View File

@ -89,30 +89,7 @@ angular.module('copayApp.controllers').controller('SendController',
var uri = address.indexOf('bitcoin:') === 0
&& copay.HDPath.parseBitcoinURI(address);
if (uri.merchant) {
var existing;
Object.keys(w.txProposals.txps).forEach(function(ntxid, i, obj) {
var txp = w.txProposals.txps[ntxid];
if (!txp) return;
var total = typeof txp.merchant.total !== 'string'
? txp.merchant.total.toString(10)
: txp.merchant.total;
if (txp.merchant.request_url === uri.merchant && total === amount) {
existing = txp;
obj.length = 0;
}
});
if (existing) {
var tx = existing.builder.build();
if (!tx.isComplete()) {
$scope.sign(existing.getID());
} else {
done(existing.getID(), existing.merchant.pr.ca);
}
} else {
w.createTx(uri.merchant, commentText, done);
}
w.createTx(uri.merchant, commentText, done);
} else {
w.createTx(address, amount, commentText, done);
}