pub trait BlockTree: BlockReader {
    fn import_blocks<I, C>(
        &mut self,
        chain: I,
        context: &C
    ) -> Result<ImportResult, Error>
    where
        I: Iterator<Item = BlockHeader>,
        C: Clock
; fn extend_tip<C>(
        &mut self,
        header: BlockHeader,
        context: &C
    ) -> Result<ImportResult, Error>
    where
        C: Clock
; }
Expand description

A representation of all known blocks that keeps track of the longest chain.

Required Methods

Import a chain of block headers into the block tree.

Attempts to extend the active chain. Returns Ok with ImportResult::TipUnchanged if the block didn’t connect, and Err if the block was invalid.

Implementors