mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Logic error in last close logic making us thing consensus was slow.
This commit is contained in:
@@ -440,24 +440,22 @@ void LedgerConsensus::statePreClose()
|
||||
int proposersClosed = mPeerPositions.size();
|
||||
|
||||
// This ledger is open. This computes how long since the last ledger closed
|
||||
uint32 lastCloseTime;
|
||||
int sinceClose;
|
||||
int ledgerInterval = 0;
|
||||
|
||||
if (mHaveCorrectLCL && mPreviousLedger->getCloseAgree())
|
||||
{ // we can use consensus timing
|
||||
lastCloseTime = mPreviousLedger->getCloseTimeNC();
|
||||
sinceClose = 1000 * (theApp->getOPs().getCloseTimeNC() - mPreviousLedger->getCloseTimeNC());
|
||||
ledgerInterval = 2 * mPreviousLedger->getCloseResolution();
|
||||
if (ledgerInterval < LEDGER_IDLE_INTERVAL)
|
||||
ledgerInterval = LEDGER_IDLE_INTERVAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastCloseTime = theApp->getOPs().getLastCloseTime();
|
||||
sinceClose = theApp->getOPs().getLastCloseTime();
|
||||
ledgerInterval = LEDGER_IDLE_INTERVAL;
|
||||
}
|
||||
|
||||
int sinceClose = 1000 * (theApp->getOPs().getCloseTimeNC() - lastCloseTime);
|
||||
|
||||
if (sinceClose >= ContinuousLedgerTiming::shouldClose(anyTransactions, mPreviousProposers, proposersClosed,
|
||||
mPreviousMSeconds, sinceClose, ledgerInterval))
|
||||
{ // it is time to close the ledger
|
||||
|
||||
Reference in New Issue
Block a user