/// The method sends adverts to peers.
The method sends adverts to peers.
The method sends adverts to peers .
fn send_advert_to_peers(&self, advert_request: GossipAdvertSendRequest) {
        let (peers, label) = match advert_request.action {
            GossipAdvertAction::SendToAllPeers => {
                (self.peer_manager.get_current_peer_ids(), "all_peers")
            }
            GossipAdvertAction::SendToRandomSubset(percentage) => (
                self.peer_manager.get_random_subset(percentage),
                "random_subset",
            ),
        };
        self.metrics
            .adverts_by_action
            .with_label_values(&[label])
            .inc_by(peers.len() as u64);
        self.send_advert_to_peer_list(advert_request.advert, peers);
    }
fn send_advert_to_peers ( & self , advert_request : GossipAdvertSendRequest ) { let ( peers , label ) = match advert_request . action { GossipAdvertAction :: SendToAllPeers => { ( self . peer_manager . get_current_peer_ids ( ) , " " ) } GossipAdvertAction :: SendToRandomSubset ( percentage ) => ( self . peer_manager . get_random_subset ( percentage ) , " " , ) , } ; self . metrics . adverts_by_action . with_label_values ( & [ label ] ) . inc_by ( peers . len ( ) as u64 ) ; self . send_advert_to_peer_list ( advert_request . advert , peers ) ; }
The method sends adverts to peers.
The method sends adverts to peers .
&self
advert_request
GossipAdvertSendRequest