taler-typescript-core

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

commit bbd2c3a8a204306b3cdfb485ffeba9d0e75e233c
parent 5fa0292ffa6d13c29b4349b57a1ab8cb386d1aa0
Author: Florian Dold <florian@dold.me>
Date:   Wed,  3 Jun 2026 19:49:31 +0200

wallet-core: fix accidentally nested transaction

Diffstat:
Mpackages/taler-wallet-cli/src/index.ts | 8++++++++
Mpackages/taler-wallet-core/src/pay-merchant.ts | 15+++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts @@ -138,6 +138,10 @@ async function doHandlePayTransaction( major: TransactionMajorState.Expired, minor: "*", }, + { + major: TransactionMajorState.Finalizing, + minor: "*", + }, ], }); const paySt = await wallet.call(WalletApiOperation.GetTransactionById, { @@ -158,6 +162,10 @@ async function doHandlePayTransaction( console.log(`Payment aborted.`); return; } + if (paySt.txState.major === TransactionMajorState.Finalizing) { + console.log(`Payment finalizing (${paySt.txState.minor})`); + return; + } if ( paySt.txState.major === TransactionMajorState.Failed && paySt.txState.minor === TransactionMinorState.Repurchase diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts @@ -2738,15 +2738,14 @@ export async function getChoicesForPayment( } else { // We use the first known scope for the // exchanges of the selected coins. - let scopeInfo = await wex.runLegacyWalletDbTx(async (tx) => { - for (const exch of exchanges) { - const s = await getExchangeScopeInfoOrUndefined(tx, exch); - if (s != null) { - return s; - } + let scopeInfo: ScopeInfo | undefined = undefined; + for (const exch of exchanges) { + const s = await getExchangeScopeInfoOrUndefined(tx, exch); + if (s != null) { + scopeInfo = s; + break; } - return undefined; - }); + } choice = { status: ChoiceSelectionDetailType.PaymentPossible, scopeInfo,