commit 660e28ad9dca82c337dc59061c3f94f9377f301a
parent be8c4cbe6ef680bcdd34c2d7b50a6f45ae327555
Author: Florian Dold <florian@dold.me>
Date: Tue, 2 Jun 2026 00:16:57 +0200
wallet-core: also abort peer-push-debit without coin selection
A bad check for the presence of a coin selection caused some
peer-push-debit transactions to never finish aborting.
Diffstat:
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/packages/taler-wallet-core/src/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/pay-peer-push-debit.ts
@@ -903,27 +903,26 @@ async function processPeerPushDebitAbortingDeletePurse(
const currency = Amounts.currencyOf(rec.amount);
const coinPubs: CoinRefreshRequest[] = [];
- if (!rec.coinSel) {
- return;
- }
+ if (rec.coinSel) {
+ for (let i = 0; i < rec.coinSel.coinPubs.length; i++) {
+ coinPubs.push({
+ amount: rec.coinSel.contributions[i],
+ coinPub: rec.coinSel.coinPubs[i],
+ });
+ }
- for (let i = 0; i < rec.coinSel.coinPubs.length; i++) {
- coinPubs.push({
- amount: rec.coinSel.contributions[i],
- coinPub: rec.coinSel.coinPubs[i],
- });
+ const refresh = await createRefreshGroup(
+ wex,
+ tx,
+ currency,
+ coinPubs,
+ RefreshReason.AbortPeerPushDebit,
+ ctx.transactionId,
+ );
+ rec.abortRefreshGroupId = refresh.refreshGroupId;
}
- rec.status = PeerPushDebitStatus.Aborted;
- const refresh = await createRefreshGroup(
- wex,
- tx,
- currency,
- coinPubs,
- RefreshReason.AbortPeerPushDebit,
- ctx.transactionId,
- );
- rec.abortRefreshGroupId = refresh.refreshGroupId;
+ rec.status = PeerPushDebitStatus.Aborted;
await h.update(rec);
});
@@ -1025,7 +1024,7 @@ export async function processPeerPushDebit(
return tx.peerPushDebit.get(pursePub);
});
if (!peerPushInitiation) {
- throw Error("peer push payment not found");
+ return TaskRunResult.finished();
}
switch (peerPushInitiation.status) {