I was researching coin selection when I came across this bug, so I thought I'd fix it
Pr #33223 adjusts weight selection to keep the lighter coin when two coins have the same value, but the test has two mistakes, as confirmed in this comment
- It builds
mixed_weight_poolbut passesutxo_pooltoTestSRDSuccess. - There is nothing enforcing coin eviction because the current max weight (
4 * 3 * 67= 804 WU) fits any two coins (544 WU)
If you reverse #33223, it still passes, which means it misses the tie-break
The fix
The test now uses `mixed_weight_pool and adds an extra light coin so that only two light coins can fit together and evicts a coin on every tie to pass. Lowers the max weight to 536 WU; SRD now has to evict the heavier coin on every tie to succeed
This should show failed tests with bitcoin#33223 reverted and pass on master.