PrevUpHomeNext

getPreferredLedger

Determine the preferred ledger based on its support.

Synopsis
template<
    class ID>
ID
getPreferredLedger(
    ID const& current,
    hash_map< ID, std::uint32_t > const& dist);
Description
Parameters

Name

Description

current

The current ledger the node follows

dist

Ledger IDs and corresponding counts of support

Return Value

The ID of the ledger with most support, preferring to stick with current ledger in the case of equal support

Header

#include <ripple/consensus/Validations.h>


PrevUpHomeNext