mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-29 14:57:25 +00:00
Some gossip improvements (#1892)
* queue messages in future * use new gossip API in GRANDPA * implement message_expired for grandpa * fix indent
This commit is contained in:
committed by
Gav Wood
parent
c21d7436cc
commit
4c8fec17fc
@@ -369,11 +369,12 @@ impl<D, S: NetworkSpecialization<Block> + Clone> Peer<D, S> {
|
||||
/// access the underlying consensus gossip handler
|
||||
pub fn consensus_gossip_messages_for(
|
||||
&self,
|
||||
engine_id: ConsensusEngineId,
|
||||
topic: <Block as BlockT>::Hash,
|
||||
) -> mpsc::UnboundedReceiver<Vec<u8>> {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
self.with_gossip(move |gossip, _| {
|
||||
let inner_rx = gossip.messages_for(topic);
|
||||
let inner_rx = gossip.messages_for(engine_id, topic);
|
||||
let _ = tx.send(inner_rx);
|
||||
});
|
||||
rx.wait().ok().expect("1. Network is running, 2. it should handle the above closure successfully")
|
||||
|
||||
Reference in New Issue
Block a user