mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Use slightly cheaper SetHex
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
@@ -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()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user