Use slightly cheaper SetHex

This commit is contained in:
JoelKatz
2013-01-28 01:14:06 -08:00
parent c543b77699
commit d3ac663c9a
2 changed files with 10 additions and 10 deletions

View File

@@ -204,7 +204,7 @@ int HashedObjectStore::import(const std::string& file)
uint256 hash; uint256 hash;
std::string hashStr; std::string hashStr;
importDB->getStr("Hash", hashStr); importDB->getStr("Hash", hashStr);
hash.SetHex(hashStr); hash.SetHex(hashStr, true);
if (hash.isZero()) if (hash.isZero())
{ {
cLog(lsWARNING) << "zero hash found in import table"; cLog(lsWARNING) << "zero hash found in import table";

View File

@@ -509,13 +509,13 @@ Ledger::pointer Ledger::getSQL(const std::string& sql)
} }
db->getStr("LedgerHash", hash); db->getStr("LedgerHash", hash);
ledgerHash.SetHex(hash); ledgerHash.SetHex(hash, true);
db->getStr("PrevHash", hash); db->getStr("PrevHash", hash);
prevHash.SetHex(hash); prevHash.SetHex(hash, true);
db->getStr("AccountSetHash", hash); db->getStr("AccountSetHash", hash);
accountHash.SetHex(hash); accountHash.SetHex(hash, true);
db->getStr("TransSetHash", hash); db->getStr("TransSetHash", hash);
transHash.SetHex(hash); transHash.SetHex(hash, true);
totCoins = db->getBigInt("TotalCoins"); totCoins = db->getBigInt("TotalCoins");
closingTime = db->getBigInt("ClosingTime"); closingTime = db->getBigInt("ClosingTime");
prevClosingTime = db->getBigInt("PrevClosingTime"); prevClosingTime = db->getBigInt("PrevClosingTime");
@@ -562,7 +562,7 @@ uint256 Ledger::getHashByIndex(uint32 ledgerIndex)
db->endIterRows(); db->endIterRows();
} }
ret.SetHex(hash); ret.SetHex(hash, true);
return ret; return ret;
} }
@@ -592,8 +592,8 @@ bool Ledger::getHashesByIndex(uint32 ledgerIndex, uint256& ledgerHash, uint256&
return false; return false;
} }
ledgerHash.SetHex(pSt.peekString(0)); ledgerHash.SetHex(pSt.peekString(0), true);
parentHash.SetHex(pSt.peekString(1)); parentHash.SetHex(pSt.peekString(1), true);
return true; return true;
@@ -614,8 +614,8 @@ bool Ledger::getHashesByIndex(uint32 ledgerIndex, uint256& ledgerHash, uint256&
db->endIterRows(); db->endIterRows();
} }
ledgerHash.SetHex(hash); ledgerHash.SetHex(hash, true);
parentHash.SetHex(prevHash); parentHash.SetHex(prevHash, true);
assert(ledgerHash.isNonZero() && ((ledgerIndex == 0) || parentHash.isNonZero())); assert(ledgerHash.isNonZero() && ((ledgerIndex == 0) || parentHash.isNonZero()));