I've been going through all the code that runs to serve a "sendtoaddress" call, to find potential improvements.
One control flow path looks like: sendtoaddress -> SendMoney -> CreateTransaction -> AvailableCoins + SelectCoins
Now, AvailableCoins iterates upon all the txn entries in the wallet and stores usable ones into a list. This list is later trimmed down by SelectCoins.
So, we end up building a huge list every time sendtoaddress is called, only to trim it down later.
Wouldn't it be better if we could tell AvailableCoins to only select coins of required value?
I think the nMinimumSumAmount parameter in AvailableCoins was made for this purpose only?