aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/scriptpubkeyman.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-07-10 16:38:12 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-04-23 13:59:48 -0400
commit58c7651821b0eeff0a99dc61d78d2e9e07986580 (patch)
tree623281d3496a9da9009b2bc796f29b36c82966c5 /src/wallet/scriptpubkeyman.h
parente014886a342508f7c8d80323eee9a5f314eaf94c (diff)
Implement TopUp in DescriptorScriptPubKeyMan
Diffstat (limited to 'src/wallet/scriptpubkeyman.h')
-rw-r--r--src/wallet/scriptpubkeyman.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h
index b0f0e8713e..7522dce9c5 100644
--- a/src/wallet/scriptpubkeyman.h
+++ b/src/wallet/scriptpubkeyman.h
@@ -492,6 +492,7 @@ private:
using KeyMap = std::map<CKeyID, CKey>;
ScriptPubKeyMap m_map_script_pub_keys GUARDED_BY(cs_desc_man);
+ int32_t m_max_cached_index = -1;
OutputType m_address_type;
bool m_internal;
@@ -505,6 +506,8 @@ private:
bool m_decryption_thoroughly_checked = false;
bool AddDescriptorKeyWithDB(WalletBatch& batch, const CKey& key, const CPubKey &pubkey);
+
+ KeyMap GetKeys() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man);
public:
DescriptorScriptPubKeyMan(WalletStorage& storage, WalletDescriptor& descriptor)
: ScriptPubKeyMan(storage),
@@ -526,6 +529,10 @@ public:
bool GetReservedDestination(const OutputType type, bool internal, CTxDestination& address, int64_t& index, CKeyPool& keypool) override;
void ReturnDestination(int64_t index, bool internal, const CTxDestination& addr) override;
+ // Tops up the descriptor cache and m_map_script_pub_keys. The cache is stored in the wallet file
+ // and is used to expand the descriptor in GetNewDestination. DescriptorScriptPubKeyMan relies
+ // more on ephemeral data than LegacyScriptPubKeyMan. For wallets using unhardened derivation
+ // (with or without private keys), the "keypool" is a single xpub.
bool TopUp(unsigned int size = 0) override;
void MarkUnusedAddresses(const CScript& script) override;