PrevUpHomeNext

getNextLedgerTimeResolution

Calculates the close time resolution for the specified ledger.

Synopsis
template<
    class duration>
duration
getNextLedgerTimeResolution(
    duration previousResolution,
    bool previousAgree,
    std::uint32_t ledgerSeq);
Description

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.

Parameters

Name

Description

previousResolution

the resolution used for the prior ledger

previousAgree

whether consensus agreed on the close time of the prior ledger

ledgerSeq

the sequence number of the new ledger

previousResolution must be a valid bin from ledgerPossibleTimeResolutions

Header

#include <ripple/consensus/LedgerTiming.h>


PrevUpHomeNext