fn make_gossip_node(
    entry_point: &SocketAddr,
    exit: &Arc<AtomicBool>,
    gossip_addr: Option<&SocketAddr>,
) -> (GossipService, Arc<RwLock<ClusterInfo>>) {
    let keypair = Arc::new(Keypair::new());
    let (node, gossip_socket) = if let Some(gossip_addr) = gossip_addr {
        ClusterInfo::gossip_node(&keypair.pubkey(), gossip_addr)
    } else {
        ClusterInfo::spy_node(&keypair.pubkey())
    };
    let mut cluster_info = ClusterInfo::new(node, keypair);
    cluster_info.set_entrypoint(ContactInfo::new_gossip_entry_point(entry_point));
    let cluster_info = Arc::new(RwLock::new(cluster_info));
    let gossip_service =
        GossipService::new(&cluster_info.clone(), None, None, gossip_socket, &exit);
    (gossip_service, cluster_info)
}
/// Makes a spy or gossip node based on whether or not a gossip_addr was passed in
/// Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
Makes a spy or gossip node based on whether or not a gossip_addr was passed in
Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
Makes a spy or gossip node based on whether or not a gossip_addr was passed in Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
fn make_gossip_node(
    entry_point: &SocketAddr,
    exit: &Arc<AtomicBool>,
    gossip_addr: Option<&SocketAddr>,
) -> (GossipService, Arc<RwLock<ClusterInfo>>) {
    let keypair = Arc::new(Keypair::new());
    let (node, gossip_socket) = if let Some(gossip_addr) = gossip_addr {
        ClusterInfo::gossip_node(&keypair.pubkey(), gossip_addr)
    } else {
        ClusterInfo::spy_node(&keypair.pubkey())
    };
    let mut cluster_info = ClusterInfo::new(node, keypair);
    cluster_info.set_entrypoint(ContactInfo::new_gossip_entry_point(entry_point));
    let cluster_info = Arc::new(RwLock::new(cluster_info));
    let gossip_service =
        GossipService::new(&cluster_info.clone(), None, None, gossip_socket, &exit);
    (gossip_service, cluster_info)
}
fn make_gossip_node ( entry_point : & SocketAddr , exit : & Arc < AtomicBool > , gossip_addr : Option < & SocketAddr > , ) -> ( GossipService , Arc < RwLock < ClusterInfo > > ) { let keypair = Arc :: new ( Keypair :: new ( ) ) ; let ( node , gossip_socket ) = if let Some ( gossip_addr ) = gossip_addr { ClusterInfo :: gossip_node ( & keypair . pubkey ( ) , gossip_addr ) } else { ClusterInfo :: spy_node ( & keypair . pubkey ( ) ) } ; let mut cluster_info = ClusterInfo :: new ( node , keypair ) ; cluster_info . set_entrypoint ( ContactInfo :: new_gossip_entry_point ( entry_point ) ) ; let cluster_info = Arc :: new ( RwLock :: new ( cluster_info ) ) ; let gossip_service = GossipService :: new ( & cluster_info . clone ( ) , None , None , gossip_socket , & exit ) ; ( gossip_service , cluster_info ) }
Makes a spy or gossip node based on whether or not a gossip_addr was passed in
Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
Makes a spy or gossip node based on whether or not a gossip_addr was passed in Pass in a gossip addr to fully participate in gossip instead of relying on just pulls
entry_point
&SocketAddr
exit
&Arc<AtomicBool>
gossip_addr
Option<&SocketAddr>
entry_point
&SocketAddr
exit
&Arc<AtomicBool>
gossip_addr
Option<&SocketAddr>