Select coins until the change output is guaranteed (B-98, BET-24)

select_utxos took the first coin covering the amount, so 10 + 1 PLM and a
10 PLM bet was refused with balance_leaves_no_change and a 10 PLM withdrawal
was reduced. User txs now ask for target + DUST_LIMIT_SATS; the old outcome is
kept only when no allowed combination leaves change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 5.5 committed 2026-10-18 00:35:17 +02:00
1 parent 264441f5d6
commit 32df50cb75
7 files changed
+77 -34

No files matched your search

+1 -5
View File
@@ -77,11 +77,7 @@ ancora `open` oltre la scadenza.
[WDR-09] scatta solo quando nessuna combinazione di monete lascia un resto
sufficiente.
*Codice:* `app/wallet/psbt_builder.py:select_utxos` ·
*Test:* —
*Stato:* da implementare (B-98) · *Oggi:* la selezione si ferma alla prima
moneta che copre il costo, e il resto si misura solo su quelle monete: con
10 + 1 PLM una scommessa da 10 PLM è rifiutata con `balance_leaves_no_change`
e un prelievo da 10 PLM viene ridotto invece di usare la seconda moneta.
*Test:* `tests/unit/test_psbt_builder.py`
- **[BET-21]** Il **costo** di una scommessa è il `bet_amount_sats`
fotografato sul round alla sua apertura