diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer.ts b/packages/taler-wallet-core/src/operations/pay-peer.ts index 92ec549dd..ebf521079 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer.ts @@ -342,6 +342,8 @@ export async function selectPeerCoins( const perExchange: PayPeerInsufficientBalanceDetails["perExchange"] = {}; + let maxFeeGapEstimate = Amounts.zeroOfCurrency(currency); + for (const exch of exchanges) { if (exch.detailsPointer?.currency !== currency) { continue; @@ -361,12 +363,15 @@ export async function selectPeerCoins( balanceMaterial: Amounts.stringify(infoExchange.balanceMaterial), feeGapEstimate: Amounts.stringify(gap), }; + + maxFeeGapEstimate = Amounts.max(maxFeeGapEstimate, gap); } const errDetails: PayPeerInsufficientBalanceDetails = { amountRequested: Amounts.stringify(instructedAmount), balanceAvailable: Amounts.stringify(infoGeneral.balanceAvailable), balanceMaterial: Amounts.stringify(infoGeneral.balanceMaterial), + feeGapEstimate: Amounts.stringify(maxFeeGapEstimate), perExchange, }; |