mirror of https://github.com/BTCPrivate/copay.git
paypro: drop existing txp check.
This commit is contained in:
parent
62fe6ce628
commit
035070b78b
|
@ -89,30 +89,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
var uri = address.indexOf('bitcoin:') === 0
|
var uri = address.indexOf('bitcoin:') === 0
|
||||||
&& copay.HDPath.parseBitcoinURI(address);
|
&& copay.HDPath.parseBitcoinURI(address);
|
||||||
if (uri.merchant) {
|
if (uri.merchant) {
|
||||||
var existing;
|
w.createTx(uri.merchant, commentText, done);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
w.createTx(address, amount, commentText, done);
|
w.createTx(address, amount, commentText, done);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue