When an object is found in the epehermal DB, put it in the cache.

This commit is contained in:
JoelKatz
2013-06-05 13:38:58 -07:00
parent 72e0ac7cd5
commit 1875ddd506

View File

@@ -192,8 +192,11 @@ HashedObject::pointer HashedObjectStore::retrieveLevelDB(const uint256& hash)
{
obj = LLRetrieve(hash, theApp->getEphemeralLDB());
if (obj)
{
mCache.canonicalize(hash, obj);
return obj;
}
}
{
LoadEvent::autoptr event(theApp->getJobQueue().getLoadEventAP(jtHO_READ, "HOS::retrieve"));
@@ -365,8 +368,11 @@ HashedObject::pointer HashedObjectStore::retrieveSQLite(const uint256& hash)
{
obj = LLRetrieve(hash, theApp->getEphemeralLDB());
if (obj)
{
mCache.canonicalize(hash, obj);
return obj;
}
}
if (!theApp || !theApp->getHashNodeDB())
return obj;