diff options
author | Samuel Dobson <dobsonsa68@gmail.com> | 2020-07-12 00:04:53 +1200 |
---|---|---|
committer | Samuel Dobson <dobsonsa68@gmail.com> | 2020-07-12 00:14:27 +1200 |
commit | 160800ac105568a59e343411d21a90e9530e1b9e (patch) | |
tree | 9e7a980cbfe7b124e875d54daa5bd60ac7011394 /src/wallet | |
parent | 5f96bce9b7f38c687817d58e8b54a5b7ebfe91b3 (diff) | |
parent | a66a7a1a7060bb422eba3b8c214852416c4280d1 (diff) |
Merge #19441: walletdb: don't reinitialize desc cache with multiple cache entries
a66a7a1a7060bb422eba3b8c214852416c4280d1 walletdb: don't reinitialize desc cache with multiple cache entries (Andrew Chow)
Pull request description:
When loading descriptor caches, we would accidentally reinitialize the descriptor cache when seeing that one already exists. This should have only been initializing the cache when one does not exist. However this code itself is unnecessary as the act of looking up the cache to add to it will initialize it if it didn't already exist.
This issue could be hit by trying to load a wallet that had imported a multisig descriptor. The wallet would fail to load.
A test has been added to wallet_importdescriptors.py to catch this case. Another test case has also been added to check that loading a wallet with only single key descriptors works.
ACKs for top commit:
hugohn:
tACK [a66a7a1](https://github.com/bitcoin/bitcoin/commit/a66a7a1a7060bb422eba3b8c214852416c4280d1)
jonatack:
ACK a66a7a1a706
meshcollider:
Code review ACK a66a7a1a7060bb422eba3b8c214852416c4280d1
Tree-SHA512: 3df746421a008708eaa3bbbdd12b9ddd3e2ec111d54625a212dca7414b971cc1f6e2b1757b3232c31a2f637d1b1ef43bf3ffa4ac4216646cf1e92db5f79954f1
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/walletdb.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 9d53f0df9c..1e5c4da6d8 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -592,9 +592,6 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, ssValue >> ser_xpub; CExtPubKey xpub; xpub.Decode(ser_xpub.data()); - if (wss.m_descriptor_caches.count(desc_id)) { - wss.m_descriptor_caches[desc_id] = DescriptorCache(); - } if (parent) { wss.m_descriptor_caches[desc_id].CacheParentExtPubKey(key_exp_index, xpub); } else { |