mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 16:05:51 +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)
|
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='";
|
std::string sql="SELECT * from Ledgers WHERE LedgerHash='";
|
||||||
sql.append(ledgerHash.GetHex());
|
sql.append(ledgerHash.GetHex());
|
||||||
sql.append("';");
|
sql.append("';");
|
||||||
Ledger::pointer ret = getSQL(sql);
|
return 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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ledger::pointer Ledger::getLastFullLedger()
|
Ledger::pointer Ledger::getLastFullLedger()
|
||||||
|
|||||||
Reference in New Issue
Block a user