taler-typescript-core

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

commit 15fdd41f97c7dca75c649a37ab2a32f258c07ad0
parent af2519576bd3459a74d412ecc93bdd4623acbe9a
Author: Iván Ávalos <avalos@disroot.org>
Date:   Sun, 15 Sep 2024 13:28:10 +0200

wallet-core: add exchange entry in preparePeerPushCredit

Diffstat:
Mpackages/taler-wallet-core/src/pay-peer-push-credit.ts | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -637,6 +637,18 @@ export async function preparePeerPushCredit( const exchangeBaseUrl = uri.exchangeBaseUrl; + try { + // If the exchange entry doesn't exist yet, + // it'll be created as an ephemeral entry. + await fetchFreshExchange(wex, exchangeBaseUrl); + } catch (e) { + // We still continued if it failed, as other exchanges might be available. + // We don't want to fail if the bank-suggested exchange is broken/offline. + logger.trace( + `querying p2p payment exchange (${exchangeBaseUrl}) failed`, + ); + } + const contractPriv = uri.contractPriv; const contractPub = encodeCrock(eddsaGetPublic(decodeCrock(contractPriv)));