commit 0f816ac79e13825e9ca89702e9024c38764ab379
parent 853ee3d2a61520048a9ede2d1f74f8efcd10cd12
Author: Florian Dold <florian@dold.me>
Date: Mon, 1 Jun 2026 15:12:42 +0200
wallet-core: check freshness of exchanges before creating refresh group
Diffstat:
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
@@ -1677,6 +1677,7 @@ advancedCli
process.on("SIGINT", cleanupSocket);
const onNotif = (notif: WalletNotification) => {
+ logger.info(`Notification: ${j2s(notif)}`);
writeObservabilityLog(notif);
};
const wh = await createLocalWallet(
diff --git a/packages/taler-wallet-core/src/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/pay-peer-push-debit.ts
@@ -860,10 +860,6 @@ async function processPeerPushDebitAbortingDeletePurse(
return TaskRunResult.finished();
}
- const currency = Amounts.currencyOf(peerPushInitiation.amount);
-
- await updateWithdrawalDenomsForCurrency(wex, currency);
-
await wex.runLegacyWalletDbTx(async (tx) => {
const [rec, h] = await ctx.getRecordHandle(tx);
if (!rec) {
diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts
@@ -1612,6 +1612,20 @@ export async function createRefreshGroup(
// FIXME: Check that involved exchanges are reasonably up-to-date.
// Otherwise, error out.
+ const exchanges: Set<string> = new Set();
+
+ for (const x of oldCoinPubs) {
+ const rec = await tx.coins.get(x.coinPub);
+ if (!rec) {
+ continue;
+ }
+ exchanges.add(rec.exchangeBaseUrl);
+ }
+
+ for (const exch of exchanges) {
+ await requireExchangeReadyTx(wex, tx, exch);
+ }
+
const refreshGroupId = encodeCrock(getRandomBytes(32));
const outInfo = await calculateRefreshOutput(wex, tx, currency, oldCoinPubs);