diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-07-10 16:38:12 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-04-23 13:59:48 -0400 |
commit | 58c7651821b0eeff0a99dc61d78d2e9e07986580 (patch) | |
tree | 623281d3496a9da9009b2bc796f29b36c82966c5 /src/wallet/walletdb.cpp | |
parent | e014886a342508f7c8d80323eee9a5f314eaf94c (diff) | |
download | bitcoin-58c7651821b0eeff0a99dc61d78d2e9e07986580.tar.xz |
Implement TopUp in DescriptorScriptPubKeyMan
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r-- | src/wallet/walletdb.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 83b77646d3..548ae1a467 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -216,6 +216,20 @@ bool WalletBatch::WriteDescriptor(const uint256& desc_id, const WalletDescriptor return WriteIC(make_pair(DBKeys::WALLETDESCRIPTOR, desc_id), descriptor); } +bool WalletBatch::WriteDescriptorDerivedCache(const CExtPubKey& xpub, const uint256& desc_id, uint32_t key_exp_index, uint32_t der_index) +{ + std::vector<unsigned char> ser_xpub(BIP32_EXTKEY_SIZE); + xpub.Encode(ser_xpub.data()); + return WriteIC(std::make_pair(std::make_pair(DBKeys::WALLETDESCRIPTORCACHE, desc_id), std::make_pair(key_exp_index, der_index)), ser_xpub); +} + +bool WalletBatch::WriteDescriptorParentCache(const CExtPubKey& xpub, const uint256& desc_id, uint32_t key_exp_index) +{ + std::vector<unsigned char> ser_xpub(BIP32_EXTKEY_SIZE); + xpub.Encode(ser_xpub.data()); + return WriteIC(std::make_pair(std::make_pair(DBKeys::WALLETDESCRIPTORCACHE, desc_id), key_exp_index), ser_xpub); +} + class CWalletScanState { public: unsigned int nKeys{0}; |