From e8ef3da7133dd9fc411fa8b3cc8b8fc2f9c58a98 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 26 Jun 2011 19:23:24 +0200 Subject: update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class) --- src/keystore.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/keystore.h (limited to 'src/keystore.h') diff --git a/src/keystore.h b/src/keystore.h new file mode 100644 index 0000000000..6080d7d7f5 --- /dev/null +++ b/src/keystore.h @@ -0,0 +1,30 @@ +// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file license.txt or http://www.opensource.org/licenses/mit-license.php. +#ifndef BITCOIN_KEYSTORE_H +#define BITCOIN_KEYSTORE_H + +class CKeyStore +{ +public: + std::map, CPrivKey> mapKeys; + mutable CCriticalSection cs_mapKeys; + virtual bool AddKey(const CKey& key); + bool HaveKey(const std::vector &vchPubKey) const + { + return (mapKeys.count(vchPubKey) > 0); + } + bool GetPrivKey(const std::vector &vchPubKey, CPrivKey& keyOut) const + { + std::map, CPrivKey>::const_iterator mi = mapKeys.find(vchPubKey); + if (mi != mapKeys.end()) + { + keyOut = (*mi).second; + return true; + } + return false; + } + std::vector GenerateNewKey(); +}; + +#endif -- cgit v1.2.3