pub trait NetworkBlock<BlockHash, BlockNumber> {
// Required methods
fn announce_block(&self, hash: BlockHash, data: Option<Vec<u8>>);
fn new_best_block_imported(&self, hash: BlockHash, number: BlockNumber);
}
Expand description
Provides ability to announce blocks to the network.
Required Methods§
Sourcefn announce_block(&self, hash: BlockHash, data: Option<Vec<u8>>)
fn announce_block(&self, hash: BlockHash, data: Option<Vec<u8>>)
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.
Sourcefn new_best_block_imported(&self, hash: BlockHash, number: BlockNumber)
fn new_best_block_imported(&self, hash: BlockHash, number: BlockNumber)
Inform the network service about new best imported block.