mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
Cleanup.
This commit is contained in:
@@ -10,7 +10,13 @@ CKey::pointer PubKeyCache::locate(const uint160& id)
|
||||
{ // is it in cache
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
CKey::pointer ret=mCache[id];
|
||||
if(ret) return ret;
|
||||
if(ret)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
std::cerr << "PubKey found in cache (locate)" << std::endl;
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
std::string sql="SELECT * from PubKeys WHERE ID='";
|
||||
@@ -49,7 +55,13 @@ CKey::pointer PubKeyCache::store(const uint160& id, CKey::pointer key)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLock);
|
||||
CKey::pointer cached(mCache[id]);
|
||||
if(cached) return cached;
|
||||
if(cached)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
std::cerr << "PubKey found in cache (store)" << std::endl;
|
||||
#endif
|
||||
return cached;
|
||||
}
|
||||
mCache[id]=key;
|
||||
}
|
||||
std::string sql="INSERT INTO PubKeys (ID, PubKey) VALUES ('";
|
||||
|
||||
@@ -12,7 +12,7 @@ class PubKeyCache
|
||||
{
|
||||
private:
|
||||
boost::mutex mLock;
|
||||
std::map<uint160,CKey::pointer> mCache;
|
||||
std::map<uint160, CKey::pointer> mCache;
|
||||
|
||||
public:
|
||||
PubKeyCache() { ; }
|
||||
|
||||
Reference in New Issue
Block a user