mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Propogate a view change during consensus to the NetworkOPs code.
This commit is contained in:
@@ -251,6 +251,8 @@ void LedgerConsensus::checkLCL()
|
||||
if (netLgr != mPrevLedgerHash)
|
||||
{ // LCL change
|
||||
Log(lsWARNING) << "View of consensus changed during consensus (" << netLgrCount << ")";
|
||||
if (mHaveCorrectLCL)
|
||||
theApp->getOPs().consensusViewChange();
|
||||
handleLCL(netLgr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ int ContinuousLedgerTiming::shouldClose(
|
||||
}
|
||||
if (previousMSeconds > (1000 * (LEDGER_IDLE_INTERVAL + 2))) // the last ledger was very slow to close
|
||||
{
|
||||
Log(lsTRACE) << "slow to close";
|
||||
Log(lsTRACE) << "slow to close (p=" << previousmSeconds) << ")";
|
||||
if (previousMSeconds < 2000)
|
||||
return previousMSeconds;
|
||||
return previousMSeconds - 1000;
|
||||
|
||||
@@ -695,6 +695,12 @@ void NetworkOPs::endConsensus(bool correctLCL)
|
||||
mConsensus = boost::shared_ptr<LedgerConsensus>();
|
||||
}
|
||||
|
||||
void NetworkOPs::consensusViewChange()
|
||||
{
|
||||
if ((mMode == omFULL) || (mMode == omTRACKING))
|
||||
setMode(omCONNECTED);
|
||||
}
|
||||
|
||||
void NetworkOPs::setMode(OperatingMode om)
|
||||
{
|
||||
if (mMode == om) return;
|
||||
|
||||
@@ -177,6 +177,7 @@ public:
|
||||
void setStandAlone() { setMode(omFULL); }
|
||||
void setStateTimer();
|
||||
void newLCL(int proposers, int convergeTime, const uint256& ledgerHash);
|
||||
void consensusViewChange();
|
||||
int getPreviousProposers() { return mLastCloseProposers; }
|
||||
int getPreviousConvergeTime() { return mLastCloseConvergeTime; }
|
||||
uint32 getLastCloseTime() { return mLastCloseTime; }
|
||||
|
||||
Reference in New Issue
Block a user