taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 3808bc19e410645bb685775e42e8734eabad6b96
parent cb5cd67d694a7227a4035062d79b37a61a980161
Author: Florian Dold <florian@dold.me>
Date:   Mon,  1 Jun 2026 19:18:40 +0200

wallet-core: limit peer push default expiration based on coin expiry

Diffstat:
Mpackages/taler-wallet-core/src/pay-peer-push-debit.ts | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/packages/taler-wallet-core/src/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/pay-peer-push-debit.ts @@ -496,13 +496,26 @@ async function internalCheckPeerPushDebit( const totalAmount = await getTotalPeerPaymentCost(wex, coins); logger.trace("computed total peer payment cost"); const exchangeBaseUrl = coinSelRes.result.exchangeBaseUrl; + let defaultExpiration = await getDefaultPeerPushExpiration( + wex, + exchangeBaseUrl, + ); + + const defaultExp = Duration.min( + Duration.fromTalerProtocolDuration(defaultExpiration), + AbsoluteTime.difference( + AbsoluteTime.now(), + AbsoluteTime.fromProtocolTimestamp(coinSelRes.result.maxExpirationDate), + ), + ); + return { type: "ok", exchangeBaseUrl, amountEffective: Amounts.stringify(totalAmount), amountRaw: req.amount, maxExpirationDate: coinSelRes.result.maxExpirationDate, - defaultExpiration: await getDefaultPeerPushExpiration(wex, exchangeBaseUrl), + defaultExpiration: Duration.toTalerProtocolDuration(defaultExp), }; }