diff options
author | Andrew Chow <achow101-github@achow101.com> | 2018-04-12 17:04:49 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2018-05-05 00:43:04 -0400 |
commit | dd3c07acce7ab67f32a79393abf6227009bd440d (patch) | |
tree | 758ce969f58e219dc7c813f8b4229cabffd000b6 /src/keystore.cpp | |
parent | f82e1c94821212cc8962775a7a29599ebd92eee0 (diff) |
Separate HaveKey function that checks whether a key is in a keystore
Diffstat (limited to 'src/keystore.cpp')
-rw-r--r-- | src/keystore.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/keystore.cpp b/src/keystore.cpp index e69d518890..ea93ed69fa 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -195,3 +195,10 @@ CKeyID GetKeyForDestination(const CKeyStore& store, const CTxDestination& dest) } return CKeyID(); } + +bool HaveKey(const CKeyStore& store, const CKey& key) +{ + CKey key2; + key2.Set(key.begin(), key.end(), !key.IsCompressed()); + return store.HaveKey(key.GetPubKey().GetID()) || store.HaveKey(key2.GetPubKey().GetID()); +} |