Skip to content

Commit

Permalink
wallet - do not swapToTrusted if mint is already default one
Browse files Browse the repository at this point in the history
  • Loading branch information
elnosh committed Oct 27, 2024
1 parent 29a96a1 commit 93e28a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 93e28a4

Please sign in to comment.