pub trait NetworkBlock<BlockHash, BlockNumber> {
    // Required methods
    fn announce_block(&self, hash: BlockHash, data: Option<Vec<u8, Global>>);
    fn new_best_block_imported(&self, hash: BlockHash, number: BlockNumber);
}
Expand description

Provides ability to announce blocks to the network.

Required Methods§

source

fn announce_block(&self, hash: BlockHash, data: Option<Vec<u8, Global>>)

Make sure an important block is propagated to peers.

In chain-based consensus, we often need to make sure non-best forks are at least temporarily synced. This function forces such an announcement.

source

fn new_best_block_imported(&self, hash: BlockHash, number: BlockNumber)

Inform the network service about new best imported block.

Implementations on Foreign Types§

source§

impl<T, BlockHash, BlockNumber> NetworkBlock<BlockHash, BlockNumber> for Arc<T>where T: NetworkBlock<BlockHash, BlockNumber> + ?Sized,

source§

fn announce_block(&self, hash: BlockHash, data: Option<Vec<u8, Global>>)

source§

fn new_best_block_imported(&self, hash: BlockHash, number: BlockNumber)

Implementors§

source§

impl<B, H> NetworkBlock<<B as Block>::Hash, <<B as Block>::Header as Header>::Number> for NetworkService<B, H>where B: BlockT + 'static, H: ExHashT,