From d0b9405f964670d6eaa8529f65fa7993b2a406c8 Mon Sep 17 00:00:00 2001 From: 251 <13120787+251Labs@users.noreply.github.com> Date: Tue, 10 Jul 2018 20:55:53 +0200 Subject: Refactors `keystore.h` type aliases. This squashed commit either encapsulates type alias declarations at the appropriate scope; or removes type aliases that are not used. The encapsulated type aliases are declared using C++11's `using` notation in favor of the `typedef` notation. --- src/keystore.h | 13 +++++-------- src/wallet/crypter.h | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/keystore.h b/src/keystore.h index 8dd2772f28..f64024c7e7 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -38,17 +38,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); @@ -74,9 +74,6 @@ public: bool HaveWatchOnly() const override; }; -typedef std::vector > CKeyingMaterial; -typedef std::map > > CryptedKeyMap; - /** Return the CKeyID of the key involved in a script (if there is a unique one). */ CKeyID GetKeyForDestination(const CKeyStore& store, const CTxDestination& dest); diff --git a/src/wallet/crypter.h b/src/wallet/crypter.h index b0a75b7020..52842cd978 100644 --- a/src/wallet/crypter.h +++ b/src/wallet/crypter.h @@ -126,6 +126,8 @@ private: bool fDecryptionThoroughlyChecked; protected: + using CryptedKeyMap = std::map>>; + bool SetCrypted(); //! will encrypt previously unencrypted keys -- cgit v1.2.3