fix: exclude failed mint from fallback candidate selection

When routstr.otrta.me rejects a Cashu token with 'mint_unreachable',
the mint fallback handler calls _spendToken with a fallback mint URL
(e.g. cubabitcoin.org). However, _spendToken's internal
_selectCandidateMints puts the highest-balance mint first regardless
of the preferredMintUrl parameter, so the fallback token was still
minted from the same unreachable mint (minibits).

Pass excludeMints: [initialMintUrl] to _spendToken so the failed
mint is excluded from candidate selection, forcing the fallback to
use the requested alternative mint.
This commit is contained in:
Paperclip Deployment Engineer
2026-07-16 07:22:12 +00:00
parent d3426a68c0
commit dfc10f5f7e
+1
View File
@@ -177,6 +177,7 @@ export function installMintUnreachableErrorRetry(
mintUrl,
amount: params.requiredSats,
baseUrl,
excludeMints: [initialMintUrl],
});
const retryToken = spendResult.token;