From 93e28a4e14064b65fa6f0ad5c34c51334aef6f48 Mon Sep 17 00:00:00 2001 From: elnosh Date: Sun, 27 Oct 2024 15:47:50 -0500 Subject: [PATCH] wallet - do not swapToTrusted if mint is already default one --- wallet/wallet.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wallet/wallet.go b/wallet/wallet.go index 075e2cb..1f411e9 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -572,6 +572,11 @@ func (w *Wallet) Receive(token cashu.Token, swapToTrusted bool) (uint64, error) } } + // if mint in token is already the default mint, do not swap to trusted + if _, ok := w.mints[tokenMint]; ok && tokenMint == w.currentMint.mintURL { + swapToTrusted = false + } + if swapToTrusted { amountSwapped, err := w.swapToTrusted(proofsToSwap, tokenMint) if err != nil {