mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Make sure we keep publishing ledgers while filling a gap from the database.
This commit is contained in:
@@ -359,6 +359,8 @@ void LedgerMaster::tryFill (Ledger::pointer ledger)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock ml (mLock);
|
||||
mCompleteLedgers.setRange (minHas, maxHas);
|
||||
mFillInProgress = false;
|
||||
tryAdvance();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -569,7 +571,7 @@ void LedgerMaster::advanceThread()
|
||||
std::list<Ledger::pointer> pubLedgers = findNewLedgersToPublish (sl);
|
||||
if (pubLedgers.empty())
|
||||
{
|
||||
if (!getConfig().RUN_STANDALONE && !getApp().getFeeTrack().isLoadedLocal() &&
|
||||
if (!mFillInProgress && !getConfig().RUN_STANDALONE && !getApp().getFeeTrack().isLoadedLocal() &&
|
||||
(getApp().getJobQueue().getJobCount(jtPUBOLDLEDGER) < 10) &&
|
||||
(mValidLedger->getLedgerSeq() == mPubLedger->getLedgerSeq()))
|
||||
{ // We are in sync, so can acquire
|
||||
@@ -610,7 +612,13 @@ void LedgerMaster::advanceThread()
|
||||
assert(ledger->getLedgerSeq() == missing);
|
||||
WriteLog (lsTRACE, LedgerMaster) << "tryAdvance acquired " << ledger->getLedgerSeq();
|
||||
setFullLedger(ledger, false, false);
|
||||
tryFill(ledger);
|
||||
if (Ledger::getHashByIndex(ledger->getLedgerSeq() - 1) == ledger->getParentHash())
|
||||
{ // Previous ledger is in DB
|
||||
sl.lock();
|
||||
mFillInProgress = true;
|
||||
getApp().getJobQueue().addJob(jtADVANCE, "tryFill", BIND_TYPE (&LedgerMaster::tryFill, this, ledger));
|
||||
sl.unlock();
|
||||
}
|
||||
progress = true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
, mMinValidations (0)
|
||||
, mLastValidateSeq (0)
|
||||
, mAdvanceThread (false)
|
||||
, mFillInProgress (false)
|
||||
, mPathFindThread (false)
|
||||
, mPathFindNewLedger (false)
|
||||
, mPathFindNewRequest (false)
|
||||
@@ -219,6 +220,7 @@ private:
|
||||
|
||||
std::list<Ledger::pointer> mPubLedgers; // List of ledgers to publish
|
||||
bool mAdvanceThread; // Publish thread is running
|
||||
bool mFillInProgress;
|
||||
|
||||
bool mPathFindThread; // Pathfind thread is running
|
||||
bool mPathFindNewLedger;
|
||||
|
||||
Reference in New Issue
Block a user