wallet: Refactor TopUp to be able to top up inactive chains too

Refactors TopUp so that it also tops up inactive chains. The bulk of
TopUp is moved to TopUpChain.

CHDChain also has 2 new in memory variables to track its highest used
indexes. This is used only for inactive hd chains so that they can be
topped up later in the same session (e.g. if the wallet is encrypted and
not unlocked at the time of MarkUnusedAddresses).
This commit is contained in:
Andrew Chow
2021-10-18 15:27:27 -04:00
parent 70134eb34f
commit 8077862c5e
3 changed files with 69 additions and 56 deletions

View File

@@ -354,6 +354,7 @@ private:
*/
bool TopUpInactiveHDChain(const CKeyID seed_id, int64_t index, bool internal);
bool TopUpChain(CHDChain& chain, unsigned int size);
public:
using ScriptPubKeyMan::ScriptPubKeyMan;