dcrwallet
dcrwallet copied to clipboard
Redundant database read in addressmanager
This issue is an attempt to solve this TODO:
https://github.com/decred/dcrwallet/blob/746bab5228037e9ba73c90914e74d90e7803c8b5/wallet/udb/addressmanager.go#L504-L507
I think this TODO is talking about the AccountProperties method when the account is not imported, one read is done to check if the account is invalid and in the accountInfo map, and another is done to get the last used address index. To make it only read once loadAccountInfo needs to store or return the index data.
However, the TODO also makes a reference to "making a change" which makes me think I don't understand the problem correctly. Are changes being made somewhere else in the code, then this is being called when those changes could return the AccountProperties?
After understanding the problem I would like to work on it.
I found #1505 that will change his area in a big way. Work should be done on top of that I guess.