diff options
author | Florian Dold <florian@dold.me> | 2021-03-27 20:48:44 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-03-27 20:48:44 +0100 |
commit | 2be1c3c8bd78b501ddf3a0b989f954f9163b3702 (patch) | |
tree | e562c21cdc3941bc9f2f5e9033250783e29e48a7 /packages/taler-wallet-core/src/util/coinSelection.ts | |
parent | 93128f935817c86172406c9de41677db125d0273 (diff) | |
download | wallet-core-2be1c3c8bd78b501ddf3a0b989f954f9163b3702.tar.xz |
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.ts | 3 |
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; |