mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Don't allow an unlimited amount of work to build up for the ledger accept engine.
This commit is contained in:
@@ -125,9 +125,8 @@ void LedgerMaster::missingAcquireComplete(LedgerAcquire::pointer acq)
|
||||
|
||||
if (!acq->isFailed())
|
||||
{
|
||||
boost::thread thread(boost::bind(&Ledger::saveAcceptedLedger, acq->getLedger(), false));
|
||||
thread.detach();
|
||||
setFullLedger(acq->getLedger());
|
||||
acq->getLedger()->pendSave(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +152,12 @@ void LedgerMaster::setFullLedger(Ledger::ref ledger)
|
||||
if (mMissingLedger || !theConfig.FULL_HISTORY)
|
||||
return;
|
||||
|
||||
if (Ledger::getPendingSaves() > 2)
|
||||
{
|
||||
cLog(lsINFO) << "Too many pending ledger saves";
|
||||
return;
|
||||
}
|
||||
|
||||
// see if there's a ledger gap we need to fill
|
||||
if (!mCompleteLedgers.hasValue(ledger->getLedgerSeq() - 1))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user