Skip to content

Commit 9b638c7

Browse files
committed
Merge #13627: Free keystore.h from file scope level type aliases
d0b9405 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
2 parents d3dae3d + d0b9405 commit 9b638c7

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/keystore.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ class CKeyStore : public SigningProvider
3838
virtual bool HaveWatchOnly() const =0;
3939
};
4040

41-
typedef std::map<CKeyID, CKey> KeyMap;
42-
typedef std::map<CKeyID, CPubKey> WatchKeyMap;
43-
typedef std::map<CScriptID, CScript > ScriptMap;
44-
typedef std::set<CScript> WatchOnlySet;
45-
4641
/** Basic key store, that keeps keys in an address->secret map */
4742
class CBasicKeyStore : public CKeyStore
4843
{
4944
protected:
5045
mutable CCriticalSection cs_KeyStore;
5146

47+
using KeyMap = std::map<CKeyID, CKey>;
48+
using WatchKeyMap = std::map<CKeyID, CPubKey>;
49+
using ScriptMap = std::map<CScriptID, CScript>;
50+
using WatchOnlySet = std::set<CScript>;
51+
5252
KeyMap mapKeys GUARDED_BY(cs_KeyStore);
5353
WatchKeyMap mapWatchKeys GUARDED_BY(cs_KeyStore);
5454
ScriptMap mapScripts GUARDED_BY(cs_KeyStore);
@@ -74,9 +74,6 @@ class CBasicKeyStore : public CKeyStore
7474
bool HaveWatchOnly() const override;
7575
};
7676

77-
typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;
78-
typedef std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char> > > CryptedKeyMap;
79-
8077
/** Return the CKeyID of the key involved in a script (if there is a unique one). */
8178
CKeyID GetKeyForDestination(const CKeyStore& store, const CTxDestination& dest);
8279

src/wallet/crypter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ class CCryptoKeyStore : public CBasicKeyStore
126126
bool fDecryptionThoroughlyChecked;
127127

128128
protected:
129+
using CryptedKeyMap = std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char>>>;
130+
129131
bool SetCrypted();
130132

131133
//! will encrypt previously unencrypted keys

0 commit comments

Comments
 (0)