mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 22:15:52 +00:00
Fix the breakage.
This commit is contained in:
@@ -538,28 +538,11 @@ Ledger::pointer Ledger::loadByIndex(uint32 ledgerIndex)
|
||||
}
|
||||
|
||||
Ledger::pointer Ledger::loadByHash(const uint256& ledgerHash)
|
||||
{ // This is a low-level function with no caching
|
||||
{ // This is a low-level function with no caching and only gets accepted ledgers
|
||||
std::string sql="SELECT * from Ledgers WHERE LedgerHash='";
|
||||
sql.append(ledgerHash.GetHex());
|
||||
sql.append("';");
|
||||
Ledger::pointer ret = getSQL(sql);
|
||||
if (ret)
|
||||
return ret;
|
||||
HashedObject::pointer node = theApp->getHashedObjectStore().retrieve(ledgerHash);
|
||||
if (!node)
|
||||
return Ledger::pointer();
|
||||
try
|
||||
{
|
||||
Ledger::pointer ledger = boost::make_shared<Ledger>(strCopy(node->getData()), true);
|
||||
if (ledger->getHash() == ledgerHash)
|
||||
return ledger;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cLog(lsDEBUG) << "Exception trying to load ledger by hash: " << ledgerHash;
|
||||
return Ledger::pointer();
|
||||
}
|
||||
return Ledger::pointer();
|
||||
return getSQL(sql);
|
||||
}
|
||||
|
||||
Ledger::pointer Ledger::getLastFullLedger()
|
||||
|
||||
Reference in New Issue
Block a user