From 672beb21794fed0f440d61c085315172773dbe2c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 12 Jul 2018 14:03:51 +0200 Subject: [PATCH] Merge #13627: Free keystore.h from file scope level type aliases d0b9405f964670d6eaa8529f65fa7993b2a406c8 Refactors `keystore.h` type aliases. (251) Pull request description: This pull request frees `keystore.h` from type alias declarations that have been declared at file scope level. `keystore.h` has various type aliases that have been declared ~3 - 6 years ago at file scope level, which can either be encapsulated or removed. Where type alias declarations are encapsulated at the appropriate scope and access level, C++11's `using` notation is used in favor of the `typedef` notation. Tree-SHA512: 1395cdc63e0c7ff5a1b1721675ad4416f71f507e999bd4ba019f03457cbfc08877848f10a8db7f5ccd2cd5ca3f5a291c986616f7703172fb6d79fba7447ffba8 --- src/keystore.h | 13 +++++-------- src/wallet/crypter.h | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/keystore.h b/src/keystore.h index 9d7cd5f0bc..61d0502869 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -39,17 +39,17 @@ public: virtual bool HaveWatchOnly() const =0; }; -typedef std::map KeyMap; -typedef std::map WatchKeyMap; -typedef std::map ScriptMap; -typedef std::set WatchOnlySet; - /** Basic key store, that keeps keys in an address->secret map */ class CBasicKeyStore : public CKeyStore { protected: mutable CCriticalSection cs_KeyStore; + using KeyMap = std::map; + using WatchKeyMap = std::map; + using ScriptMap = std::map; + using WatchOnlySet = std::set; + KeyMap mapKeys GUARDED_BY(cs_KeyStore); WatchKeyMap mapWatchKeys GUARDED_BY(cs_KeyStore); ScriptMap mapScripts GUARDED_BY(cs_KeyStore); @@ -77,7 +77,4 @@ public: virtual bool GetHDChain(CHDChain& hdChainRet) const; }; -typedef std::vector > CKeyingMaterial; -typedef std::map > > CryptedKeyMap; - #endif // BITCOIN_KEYSTORE_H diff --git a/src/wallet/crypter.h b/src/wallet/crypter.h index 21be885de4..6789031091 100644 --- a/src/wallet/crypter.h +++ b/src/wallet/crypter.h @@ -134,6 +134,8 @@ private: bool fOnlyMixingAllowed; protected: + using CryptedKeyMap = std::map>>; + bool SetCrypted(); //! will encrypt previously unencrypted keys