mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix the race condition bug Jed reported. A time jump on startup could cause
an apparently overly-long (or even negative) ledger interval. The fix is to start up time synch earlier and to tolerate slight negative ledger intervals.
This commit is contained in:
@@ -19,8 +19,8 @@ int ContinuousLedgerTiming::shouldClose(
|
||||
int previousMSeconds, // seconds the previous ledger took to reach consensus
|
||||
int currentMSeconds) // seconds since the previous ledger closed
|
||||
{
|
||||
assert((previousMSeconds > 0) && (previousMSeconds < 600000));
|
||||
assert((currentMSeconds >= 0) && (currentMSeconds < 600000));
|
||||
assert((previousMSeconds > -1000) && (previousMSeconds < 600000));
|
||||
assert((currentMSeconds >= -1000) && (currentMSeconds < 600000));
|
||||
|
||||
#if 0
|
||||
Log(lsTRACE) << boost::str(boost::format("CLC::shouldClose Trans=%s, Prop: %d/%d, Secs: %d (last:%d)") %
|
||||
@@ -44,12 +44,6 @@ int ContinuousLedgerTiming::shouldClose(
|
||||
return LEDGER_IDLE_INTERVAL * 1000; // normal idle
|
||||
}
|
||||
|
||||
if (previousMSeconds == (1000 * LEDGER_IDLE_INTERVAL)) // coming out of idle, close now
|
||||
{
|
||||
Log(lsTRACE) << "leaving idle, close now";
|
||||
return currentMSeconds;
|
||||
}
|
||||
|
||||
Log(lsTRACE) << "close now";
|
||||
return currentMSeconds; // this ledger should close now
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user