mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
GRANDPA: announce blocks we vote on to peers (#1593)
* announce blocks we vote on to peers (missing network impl) * Implemented 'announce' * Fixed test * improve announce docs and add logging * Track recently announced blocks
This commit is contained in:
committed by
André Silva
parent
0078927ac5
commit
d027123059
@@ -200,6 +200,14 @@ impl<B: BlockT + 'static, S: NetworkSpecialization<B>, H: ExHashT> Service<B, S,
|
||||
self.handler.propagate_extrinsics(&mut NetSyncIo::new(&self.network, self.protocol_id));
|
||||
}
|
||||
|
||||
/// 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.
|
||||
pub fn announce_block(&self, hash: B::Hash) {
|
||||
self.handler.announce_block(&mut NetSyncIo::new(&self.network, self.protocol_id), hash);
|
||||
}
|
||||
|
||||
/// Send a consensus message through the gossip
|
||||
pub fn gossip_consensus_message(&self, topic: B::Hash, message: Vec<u8>, broadcast: bool) {
|
||||
self.handler.gossip_consensus_message(
|
||||
|
||||
Reference in New Issue
Block a user