Small fixes.

This commit is contained in:
JoelKatz
2013-01-09 10:14:18 -08:00
parent d2d84d2af7
commit 714b3fb0d0
2 changed files with 5 additions and 3 deletions

View File

@@ -33,7 +33,6 @@ bool HashedObjectStore::store(HashedObjectType type, uint32 index,
}
assert(hash == Serializer::getSHA512Half(data));
mNegativeCache.del(hash);
HashedObject::pointer object = boost::make_shared<HashedObject>(type, index, data, hash);
if (!mCache.canonicalize(hash, object))
{
@@ -48,6 +47,7 @@ bool HashedObjectStore::store(HashedObjectType type, uint32 index,
}
// else
// cLog(lsTRACE) << "HOS: already had " << hash;
mNegativeCache.del(hash);
return true;
}
@@ -152,6 +152,7 @@ HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash)
db->getStr("ObjType", type);
if (type.size() == 0)
{
assert(false);
mNegativeCache.add(hash);
return HashedObject::pointer();
}
@@ -173,6 +174,7 @@ HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash)
case 'A': htype = hotACCOUNT_NODE; break;
case 'N': htype = hotTRANSACTION_NODE; break;
default:
assert(false);
cLog(lsERROR) << "Invalid hashed object";
mNegativeCache.add(hash);
return HashedObject::pointer();