fn run_gossip(obj: &Arc<RwLock<Self>>, blob_sender: &BlobSender) -> Result<()> {
        //TODO we need to keep track of stakes and weight the selection by stake size
        //TODO cache sockets

        // Lock the object only to do this operation and not for any longer
        // especially not when doing the `sock.send_to`
        let (remote_gossip_addr, req) = obj
            .read()
            .expect("'obj' read lock in fn run_gossip")
            .gossip_request()?;

        // TODO this will get chatty, so we need to first ask for number of updates since
        // then only ask for specific data that we dont have
        let blob = to_blob(req, remote_gossip_addr)?;
        blob_sender.send(vec![blob])?;
        Ok(())
    }
/// At random pick a node and try to get updated changes from them
At random pick a node and try to get updated changes from them
At random pick a node and try to get updated changes from them
fn run_gossip(obj: &Arc<RwLock<Self>>, blob_sender: &BlobSender) -> Result<()> {
        //TODO we need to keep track of stakes and weight the selection by stake size
        //TODO cache sockets
        // Lock the object only to do this operation and not for any longer
        // especially not when doing the `sock.send_to`
        let (remote_gossip_addr, req) = obj
            .read()
            .expect("'obj' read lock in fn run_gossip")
            .gossip_request()?;
        // TODO this will get chatty, so we need to first ask for number of updates since
        // then only ask for specific data that we dont have
        let blob = to_blob(req, remote_gossip_addr)?;
        blob_sender.send(vec![blob])?;
        Ok(())
    }
fn run_gossip ( obj : & Arc < RwLock < Self > > , blob_sender : & BlobSender ) -> Result < ( ) > { //TODO we need to keep track of stakes and weight the selection by stake size //TODO cache sockets // Lock the object only to do this operation and not for any longer // especially not when doing the `sock.send_to` let ( remote_gossip_addr , req ) = obj . read ( ) . expect ( " " ) . gossip_request ( ) ? ; // TODO this will get chatty, so we need to first ask for number of updates since // then only ask for specific data that we dont have let blob = to_blob ( req , remote_gossip_addr ) ? ; blob_sender . send ( vec ! [ blob ] ) ? ; Ok ( ( ) ) }
At random pick a node and try to get updated changes from them
At random pick a node and try to get updated changes from them
obj
&Arc<RwLock<Self>>
blob_sender
&BlobSender
obj
&Arc<RwLock<Self>>
blob_sender
&BlobSender