/// The method broadcasts the given advert.
The method broadcasts the given advert.
The method broadcasts the given advert .
fn broadcast_advert(&self, advert: GossipAdvert, advert_class: AdvertClass) {
        // Translate the advert request to internal format
        let advert_request = match self.advert_builder.build(advert, advert_class) {
            Some(request) => request,
            None => return,
        };
        let sender = {
            let send_map = self.peer_flows.send_advert.send_map.read().unwrap();
            // channel for self.node_id is populated in the constructor
            send_map.get(&self.node_id).unwrap().clone()
        };
        sender
            .try_send(advert_request)
            .or_else::<TrySendError<GossipAdvert>, _>(|e| {
                if let TrySendError::Closed(_) = e {
                    info!(self.log, "Send advert channel closed");
                };
                Ok(())
            })
            .unwrap();
    }
fn broadcast_advert ( & self , advert : GossipAdvert , advert_class : AdvertClass ) { // Translate the advert request to internal format let advert_request = match self . advert_builder . build ( advert , advert_class ) { Some ( request ) => request , None => return , } ; let sender = { let send_map = self . peer_flows . send_advert . send_map . read ( ) . unwrap ( ) ; // channel for self.node_id is populated in the constructor send_map . get ( & self . node_id ) . unwrap ( ) . clone ( ) } ; sender . try_send ( advert_request ) . or_else :: < TrySendError < GossipAdvert > , _ > ( | e | { if let TrySendError :: Closed ( _ ) = e { info ! ( self log " " ) ; } ; Ok ( ( ) ) } ) . unwrap ( ) ; }
The method broadcasts the given advert.
The method broadcasts the given advert .
&self
advert
GossipAdvert
advert_class
AdvertClass