Trait sp_blockchain::ForkBackend
source · 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>, Error> { ... }
}
Expand description
Handles stale forks.
Provided Methods§
sourcefn expand_forks(
&self,
fork_heads: &[Block::Hash],
) -> Result<BTreeSet<Block::Hash>, Error>
fn expand_forks( &self, fork_heads: &[Block::Hash], ) -> Result<BTreeSet<Block::Hash>, Error>
Returns block hashes for provided fork heads. It skips the fork if when blocks are missing
(e.g. warp-sync) and internal tree_route
function fails.
Example: G — A1 — A2 — A3 — A4 ( < fork1 ) -––C4 — C5 ( < fork2 ) We finalize A3 and call expand_fork(C5). Result = (C5,C4).