mirror of
https://github.com/Routstr/routstrd.git
synced 2026-08-09 03:44:38 +00:00
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:
@@ -177,6 +177,7 @@ export function installMintUnreachableErrorRetry(
|
||||
mintUrl,
|
||||
amount: params.requiredSats,
|
||||
baseUrl,
|
||||
excludeMints: [initialMintUrl],
|
||||
});
|
||||
|
||||
const retryToken = spendResult.token;
|
||||
|
||||
Reference in New Issue
Block a user