diff options
author | Florian Dold <florian@dold.me> | 2021-12-01 18:07:55 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-12-01 18:07:55 +0100 |
commit | 9f60e3d7ec989f7f0a3db13af8a902f237c77559 (patch) | |
tree | 61e6874ba10081fe10b304a6fcaf083be7d7c42c /packages/taler-wallet-core/src/operations/pay.ts | |
parent | 2dc876d6d6e766eeeda4efdb2c4e1d0ac19fa524 (diff) | |
download | wallet-core-9f60e3d7ec989f7f0a3db13af8a902f237c77559.tar.xz |
wallet: use correct denoms as refresh targets
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay.ts b/packages/taler-wallet-core/src/operations/pay.ts index 73fc6537c..5aa234963 100644 --- a/packages/taler-wallet-core/src/operations/pay.ts +++ b/packages/taler-wallet-core/src/operations/pay.ts @@ -162,8 +162,10 @@ export async function getTotalPaymentCost( ); } const allDenoms = await tx.denominations.indexes.byExchangeBaseUrl - .iter() - .toArray(); + .iter(coin.exchangeBaseUrl) + .filter((x) => + Amounts.isSameCurrency(x.value, pcs.coinContributions[i]), + ); const amountLeft = Amounts.sub(denom.value, pcs.coinContributions[i]) .amount; const refreshCost = getTotalRefreshCost(allDenoms, denom, amountLeft); |