PrevUpHomeNext

shouldCloseLedger

Determines whether the current ledger should close at this time.

Synopsis
bool
shouldCloseLedger(
    bool anyTransactions,
    std::size_t prevProposers,
    std::size_t proposersClosed,
    std::size_t proposersValidated,
    std::chrono::milliseconds prevRoundTime,
    std::chrono::milliseconds timeSincePrevClose,
    std::chrono::milliseconds openTime,
    std::chrono::milliseconds idleInterval,
    ConsensusParms const& parms,
    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

prevProposers

proposers in the last closing

proposersClosed

proposers who have currently closed this ledger

proposersValidated

proposers who have validated the last closed ledger

prevRoundTime

time for the previous ledger to reach consensus

timeSincePrevClose

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

openTime

duration this ledger has been open

idleInterval

the network's desired idle interval

parms

|6|Consensus constant parameters

j

journal for logging

Header

#include <ripple/consensus/Consensus.h>


PrevUpHomeNext