From ff046aeeba8d4f3ff210d37ba020616c12450ab3 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 27 Apr 2020 14:20:00 +0000 Subject: [PATCH 1/2] wallet: Make sure no DescriptorScriptPubKeyMan members are uninitialized after construction --- src/wallet/scriptpubkeyman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 3117b13d357..313ba34dfa1 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -497,7 +497,7 @@ private: int32_t m_max_cached_index = -1; OutputType m_address_type; - bool m_internal; + bool m_internal = false; KeyMap m_map_keys GUARDED_BY(cs_desc_man); CryptedKeyMap m_map_crypted_keys GUARDED_BY(cs_desc_man); From 2a780980983f4b4aaae75817e57e7ed308713561 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 27 Apr 2020 14:20:26 +0000 Subject: [PATCH 2/2] wallet: Make sure no WalletDescriptor members are uninitialized after construction --- src/wallet/walletutil.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/walletutil.h b/src/wallet/walletutil.h index d7e07ed04c0..599b1a9f5a2 100644 --- a/src/wallet/walletutil.h +++ b/src/wallet/walletutil.h @@ -92,10 +92,10 @@ class WalletDescriptor { public: std::shared_ptr descriptor; - uint64_t creation_time; - int32_t range_start; // First item in range; start of range, inclusive, i.e. [range_start, range_end). This never changes. - int32_t range_end; // Item after the last; end of range, exclusive, i.e. [range_start, range_end). This will increment with each TopUp() - int32_t next_index; // Position of the next item to generate + uint64_t creation_time = 0; + int32_t range_start = 0; // First item in range; start of range, inclusive, i.e. [range_start, range_end). This never changes. + int32_t range_end = 0; // Item after the last; end of range, exclusive, i.e. [range_start, range_end). This will increment with each TopUp() + int32_t next_index = 0; // Position of the next item to generate DescriptorCache cache; ADD_SERIALIZE_METHODS;