/// Broadcasts given message to all peers.
Broadcasts given message to all peers.
Broadcasts given message to all peers .
fn broadcast<M: Into<SignedMessage>>(&mut self, message: M) {
        let peers: Vec<PublicKey> = self
            .state
            .peers()
            .iter()
            .filter_map(|(pubkey, _)| {
                if self.state.connect_list().is_peer_allowed(pubkey) {
                    Some(*pubkey)
                } else {
                    None
                }
            })
            .collect();
        let message = message.into();
        for address in peers {
            self.send_to_peer(address, message.clone());
        }
    }
fn broadcast < M : Into < SignedMessage > > ( & mut self , message : M ) { let peers : Vec < PublicKey > = self . state . peers ( ) . iter ( ) . filter_map ( | ( pubkey , _ ) | { if self . state . connect_list ( ) . is_peer_allowed ( pubkey ) { Some ( * pubkey ) } else { None } } ) . collect ( ) ; let message = message . into ( ) ; for address in peers { self . send_to_peer ( address , message . clone ( ) ) ; } }
Broadcasts given message to all peers.
Broadcasts given message to all peers .
&mut self
message
M