summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/util/coinSelection.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-03-27 20:48:44 +0100
committerFlorian Dold <florian@dold.me>2021-03-27 20:48:44 +0100
commit2be1c3c8bd78b501ddf3a0b989f954f9163b3702 (patch)
treee562c21cdc3941bc9f2f5e9033250783e29e48a7 /packages/taler-wallet-core/src/util/coinSelection.ts
parent93128f935817c86172406c9de41677db125d0273 (diff)
downloadwallet-core-2be1c3c8bd78b501ddf3a0b989f954f9163b3702.tar.gz
wallet-core-2be1c3c8bd78b501ddf3a0b989f954f9163b3702.tar.bz2
wallet-core-2be1c3c8bd78b501ddf3a0b989f954f9163b3702.zip
re-add tests, more coin selection tests
Diffstat (limited to 'packages/taler-wallet-core/src/util/coinSelection.ts')
-rw-r--r--packages/taler-wallet-core/src/util/coinSelection.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/util/coinSelection.ts b/packages/taler-wallet-core/src/util/coinSelection.ts
index a840993c4..e1fec5c97 100644
--- a/packages/taler-wallet-core/src/util/coinSelection.ts
+++ b/packages/taler-wallet-core/src/util/coinSelection.ts
@@ -284,9 +284,10 @@ export function selectPayCoins(
for (const aci of candidateCoins) {
// Don't use this coin if depositing it is more expensive than
// the amount it would give the merchant.
- if (Amounts.cmp(aci.feeDeposit, aci.availableAmount) >= 0) {
+ if (Amounts.cmp(aci.feeDeposit, aci.availableAmount) > 0) {
continue;
}
+
if (Amounts.isZero(tally.amountPayRemaining)) {
// We have spent enough!
break;