pub trait ChainSelection {
    fn select_secure_chain(
        &mut self,
        candidates: Vec<Self>
    ) -> Result<(), ConsensusError>
    where
        Self: Sized
; fn select_longer_chain(
        &mut self,
        candidate: Self
    ) -> Result<(), ConsensusError>
    where
        Self: Sized
; fn is_short_range(&self, candidate: &Self) -> Result<bool, ConsensusError>; fn relative_min_window_density(
        &self,
        candidate: &Self
    ) -> Result<u32, ConsensusError>; fn config(&self) -> ConsensusConstants; }
Expand description

A trait that defines operations for chain selection

Required Methods

Top level API to select between chains during a fork.

Selects the longer chain when there’s a short range fork.

Checks whether the fork is short range wrt to candidate chain

Calculates the relate minimum window density wrt to candidate chain.

Constants used for consensus

Implementors