pub trait ForkBackend<Block: BlockT>: HeaderMetadata<Block> + HeaderBackend<Block> + Send + Sync {
    // Provided method
    fn expand_forks(
        &self,
        fork_heads: &[Block::Hash]
    ) -> Result<BTreeSet<Block::Hash>, (BTreeSet<Block::Hash>, Error)> { ... }
}
Expand description

Handles stale forks.

Provided Methods§

source

fn expand_forks( &self, fork_heads: &[Block::Hash] ) -> Result<BTreeSet<Block::Hash>, (BTreeSet<Block::Hash>, Error)>

Best effort to get all the header hashes that are part of the provided forks starting only from the fork heads.

The function tries to reconstruct the route from the fork head to the canonical chain. If any of the hashes on the route can’t be found in the db, the function won’t be able to reconstruct the route anymore. In this case it will give up expanding the current fork, move on to the next ones and at the end it will return an error that also contains the partially expanded forks.

Implementors§

source§

impl<Block, T> ForkBackend<Block> for Twhere Block: BlockT, T: HeaderMetadata<Block> + HeaderBackend<Block> + Send + Sync,