PrevUpHomeNext

Validations::getPreferredLCL

Determine the preferred last closed ledger for the next consensus round.

Synopsis
ID
getPreferredLCL(
    Ledger const& lcl,
    Seq minSeq,
    hash_map< ID, std::uint32_t > const& peerCounts);
Description

Called before starting the next round of ledger consensus to determine the preferred working ledger. Uses the dominant peerCount ledger if no trusted validations are available.

Parameters

Name

Description

lcl

Last closed ledger by this node

minSeq

Minimum allowed sequence number of the trusted preferred ledger

peerCounts

Map from ledger ids to count of peers with that as the last closed ledger

Return Value

The preferred last closed ledger ID

Remarks

The minSeq does not apply to the peerCounts, since this function does not know their sequence number


PrevUpHomeNext