Hi,
This is an issue that is plaguing me since months, and I'd like to ask if there is any solution to it.
Often, when I try to send a large amount of BTC, I get the following message:
error: {"code":-4,"message":"Error: Transaction creation failed "}
If this error happens, I try sending a smaller amount. Eventually this succeeds. There is always a treshold below which the transaction can be created successfully. However the treshold is not a static value, but rather depends on some internal details of my wallet. Sometimes the treshold is lower than 1 BTC, sometimes it is near 200 BTC. After each successful send, the treshold jumps a different value (higher or lower). I cannot send more than 200 BTC ever anymore since the problem started to appear, and it becomes worse and worse with time.
After googling this forum and other sites, my understanding is that the error occurs because the transaction becomes too complex. The source of it seems to be "wallet pollution" where many small inputs exist and bitcoind wants to combine too many of them into the transaction.
My wallet file is 2.3 MB, and certainly there may be many small items in it. However there are also plenty of large items that could be used to form the desired transaction (without reaching the excessive complexity). Bitcoind seems to use a poor strategy in choosing the inputs from the available ones.
The problem appears accross many versions of bitcoin, including v0.3.x and v0.6.3, and on several machines. It never appears on a fresh install, only starts to appear after the wallet has grown a lot, and then becomes worse with time.
My questions:
1. Do I have some way to influence which inputs are chosen? For example, can I choose 10 "virgin" coins for a 500 BTC transaction, instead of thousands of 0.01xxx inputs?
2. Can I somehow view the details of my wallet? I imagine that I could send the offending small inputs away to a different wallet, if I only knew their exact face value and the order in which they appear in the wallet.
3. Is there any other way to "clean" my wallet, or reorder the items in it so that the offending items will be selected last instead of first?
I am living with the problem, but it gets worse and worse every week. I cannot ignore it much longer. Right now I am thinking about this resolution strategy: Fresh install on a new box. Try to send 99.9 BTC to the new box. If fails, decrease the amount by 0.1 BTC and retry (until success). Start over with 99.9. Continue until the wallet is empty or near empty. Delete the remaining wallet file. Obviously this method is costly because of the TX fees involved.