I have a wallet that has several hundred small amounts residing at multiple addresses. I noticed yesterday that, when sending a relatively small amount to a third party that the bitcoind "swept" about 47 of those small amounts together as vin
amounts and generated two vout
destinations; 1 is the third party, the second is a new address in the wallet (a change address).
What surprised me is that, rather than assembling only the number of fragments necessary for the transfer (plus fee), it swept many of the fragments together to generate a much larger than necessary change transfer.
To give some specifics but to keep it simple:
- I initiated a
sendtoaddress
via the cli. The amount transferred was 0.004 BTC - Bitcoind used some 47 existing fragments as vin, generating a total value of 0.08+ BTC
Is there any way, aside from manually generating a raw transaction (which I can do, but I prefer not to when I can avoid it since a simple error can result in inadvertently generating a large fee amount... :) ) to force sendtoaddress
to assemble only the minimal pieces needed?