SHAMap sync now passes its unit test with the "full below" optimization

disabled. There's a logic error in the implementation.
This commit is contained in:
JoelKatz
2012-02-01 19:10:07 -08:00
parent 86687e2012
commit 5888d19f2b
3 changed files with 42 additions and 21 deletions

View File

@@ -39,6 +39,7 @@ CREATE INDEX ObjectLocate ON CommittedObjects(LedgerIndex, ObjType);
bool HashedObject::store(HashedObjectType type, uint32 index, const std::vector<unsigned char>& data,
const uint256& hash)
{
if(!theApp->getHashNodeDB()) return true;
#ifdef DEBUG
Serializer s(data);
assert(hash==s.getSHA512Half());
@@ -76,6 +77,7 @@ bool HashedObject::store() const
HashedObject::pointer HashedObject::retrieve(const uint256& hash)
{
if(!theApp->getHashNodeDB()) return HashedObject::pointer();
std::string sql="SELECT * from CommitedObjects WHERE Hash='";
sql.append(hash.GetHex());
sql.append("';");