#17603 notes behavior where avoidreuse will only spend 1 of the UTXO:s ~and mark all of them as spent~. This is ~correct~ currently expected behavior, but the reasoning is non-obvious: the user creates 31 outputs, and the code groups these into 4 groups, 3x10 and 1x1. It then ends up using the 1x1 group because it is smaller => fewer fees.
This PR adds a test that explicitly checks this case, but in a more direct manner; it creates 30 outputs of 1 btc each, all sending to the same destination, and the receiver then sends 11 btc back. From [10, 10, 10] coin select will pick 2, leave 1 alone, and create 11 out/9 change. The user will end up with 10 btc used, 9 btc unused. 19 btc unused.*
(* this is because the system is currently set up to mark things as they come into the wallet; already existing stuff is only marked if the user does a rescan, which the caveat states when enabling the flag)