The cache of IDs<->PubKeys. Also handles storing them to the SQL db.

This commit is contained in:
JoelKatz
2011-12-03 22:19:50 -08:00
parent 2dfb920db0
commit 604c9721e9
2 changed files with 96 additions and 0 deletions

25
PubKeyCache.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef __PUBKEYCACHE__
#define __PUBKEYCACHE__
#include <map>
#include "boost/thread/mutex.hpp"
#include "uint256.h"
#include "key.h"
class PubKeyCache
{
private:
boost::mutex mLock;
std::map<uint160,CKey::pointer> mCache;
public:
PubKeyCache() { ; }
CKey::pointer locate(const uint160& id);
void store(const uint160& id, CKey::pointer key);
void clear(void);
};
#endif