Fixes #17603 (together with #17843)
In the case of destination groups of >10 outputs existing in a wallet with avoid_reuse
enabled, the grouping algorithm is adding left-over outputs as an “incomplete” group to the list of groups even when a full group has already been added. This leads to the strange behavior that if there are >10 outputs for a destination the transaction spending from that will effectively use len(outputs) % 10
as inputs for that transaction.
From the original PR and the code comment I understand the correct behavior should be the usage of 10 outputs. I opted for minimal changes in the current code although there maybe optimizations possible for cases with >20 outputs on a destination this sounds like too much of an edge case right now.