This PR tries to improve the performance of the listunspent
, fundrawtransaction
, sendtoaddress
and other RPC calls by improving CWallet::AvailableCoins()
iteration through the wallet transactions.
E.g. If a given address is an outpoint of N transactions, I guess there’s no point to check N times if the address IsMine()
.
This PR supersedes #7823 although it’s a different approach. In that PR, caching accurately those values was a little tricky because of all the scenarios that could make the cache invalidated (conflicts, double-spends, reorganizations, abandoned transactions, etc, …).
Still, with this approach I got performance gains up to 90% on CWallet::AvailableCoins()
for large wallets.