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,7 +192,10 @@ HashedObject::pointer HashedObjectStore::retrieveLevelDB(const uint256& hash)
{ {
obj = LLRetrieve(hash, theApp->getEphemeralLDB()); obj = LLRetrieve(hash, theApp->getEphemeralLDB());
if (obj) if (obj)
{
mCache.canonicalize(hash, obj);
return obj; return obj;
}
} }
{ {
@@ -365,7 +368,10 @@ HashedObject::pointer HashedObjectStore::retrieveSQLite(const uint256& hash)
{ {
obj = LLRetrieve(hash, theApp->getEphemeralLDB()); obj = LLRetrieve(hash, theApp->getEphemeralLDB());
if (obj) if (obj)
{
mCache.canonicalize(hash, obj);
return obj; return obj;
}
} }
if (!theApp || !theApp->getHashNodeDB()) if (!theApp || !theApp->getHashNodeDB())