Calculates the close time resolution for the specified ledger.
template< class duration> duration getNextLedgerTimeResolution( duration previousResolution, bool previousAgree, std::uint32_t ledgerSeq);
The Ripple protocol uses binning to represent time intervals using only one timestamp. This allows servers to derive a common time for the next ledger, without the need for perfectly synchronized clocks. The time resolution (i.e. the size of the intervals) is adjusted dynamically based on what happened in the last ledger, to try to avoid disagreements.
Name |
Description |
---|---|
|
the resolution used for the prior ledger |
|
whether consensus agreed on the close time of the prior ledger |
|
the sequence number of the new ledger |
previousResolution must be a valid bin from ledgerPossibleTimeResolutions
#include <ripple/consensus/LedgerTiming.h>