PrevUpHomeNext

shouldCloseLedger

Determines whether the current ledger should close at this time.

Synopsis
bool
shouldCloseLedger(
    bool anyTransactions,
    std::size_t previousProposers,
    std::size_t proposersClosed,
    std::size_t proposersValidated,
    std::chrono::milliseconds previousTime,
    std::chrono::milliseconds currentTime,
    std::chrono::milliseconds openTime,
    std::chrono::seconds idleInterval,
    beast::Journal j);
Description

This function should be called when a ledger is open and there is no close in progress, or when a transaction is received and no close is in progress.

Parameters

Name

Description

anyTransactions

indicates whether any transactions have been received

previousProposers

proposers in the last closing

proposersClosed

proposers who have currently closed this ledger

proposersValidated

proposers who have validated the last closed ledger

previousTime

time for the previous ledger to reach consensus

currentTime

time since the previous ledger's (possibly rounded) close time

openTime

time waiting to close this ledger

idleInterval

the network's desired idle interval

j

journal for logging

Header

#include <ripple/consensus/LedgerTiming.h>


PrevUpHomeNext