mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-12 04:03:21 +00:00
The same-mint shortcut in swap_to_primary_mint did a same-mint split(include_fees=True) — which burns the mint's NUT-02 per-proof input fee — but returned the full token amount, over-crediting the user (the same bug already fixed for the trusted-mint receive path). It also skipped DLEQ verification that the trusted path performs. Extract the shared same-mint redeem into _redeem_same_mint (load mint, verify DLEQ, split, credit amount - input_fees) and delegate from both recieve_token and the shortcut, so the two paths can't drift again. This shortcut is reachable when PRIMARY_MINT_URL is set outside CASHU_MINTS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>