async fn crawl_transactions(&mut self) -> Result<(), BoxError> {
        let peer_set = self.peer_set.clone();

        trace!("Crawling for mempool transactions");

        let mut requests = FuturesUnordered::new();
        // get readiness for one peer at a time, to avoid peer set contention
        for attempt in 0..FANOUT {
            if attempt > 0 {
                // Let other tasks run, so we're more likely to choose a different peer.
                //
                // TODO: move fanouts into the PeerSet, so we always choose different peers (#2214)
                tokio::task::yield_now().await;
            }

            let mut peer_set = peer_set.clone();
            // end the task on permanent peer set errors
            let peer_set = peer_set.ready().await?;

            requests.push(peer_set.call(zn::Request::MempoolTransactionIds));
        }

        while let Some(result) = requests.next().await {
            // log individual response errors
            match result {
                Ok(response) => self.handle_response(response).await?,
                // TODO: Reduce the log level of the errors (#2655).
                Err(error) => info!("Failed to crawl peer for mempool transactions: {}", error),
            }
        }

        Ok(())
    }
/// Crawl peers for transactions.
///
/// Concurrently request [`FANOUT`] peers for transactions to include in the mempool.
Crawl peers for transactions.
Concurrently request [`FANOUT`] peers for transactions to include in the mempool.
Crawl peers for transactions . Concurrently request [ ` FANOUT ` ] peers for transactions to include in the mempool .
async fn crawl_transactions(&mut self) -> Result<(), BoxError> {
        let peer_set = self.peer_set.clone();
        trace!("Crawling for mempool transactions");
        let mut requests = FuturesUnordered::new();
        // get readiness for one peer at a time, to avoid peer set contention
        for attempt in 0..FANOUT {
            if attempt > 0 {
                // Let other tasks run, so we're more likely to choose a different peer.
                //
                // TODO: move fanouts into the PeerSet, so we always choose different peers (#2214)
                tokio::task::yield_now().await;
            }
            let mut peer_set = peer_set.clone();
            // end the task on permanent peer set errors
            let peer_set = peer_set.ready().await?;
            requests.push(peer_set.call(zn::Request::MempoolTransactionIds));
        }
        while let Some(result) = requests.next().await {
            // log individual response errors
            match result {
                Ok(response) => self.handle_response(response).await?,
                // TODO: Reduce the log level of the errors (#2655).
                Err(error) => info!("Failed to crawl peer for mempool transactions: {}", error),
            }
        }
        Ok(())
    }
async fn crawl_transactions ( & mut self ) -> Result < ( ) , BoxError > { let peer_set = self . peer_set . clone ( ) ; trace ! ( " " ) ; let mut requests = FuturesUnordered :: new ( ) ; // get readiness for one peer at a time, to avoid peer set contention for attempt in 0 .. FANOUT { if attempt > 0 { // Let other tasks run, so we're more likely to choose a different peer. // // TODO: move fanouts into the PeerSet, so we always choose different peers (#2214) tokio :: task :: yield_now ( ) . await ; } let mut peer_set = peer_set . clone ( ) ; // end the task on permanent peer set errors let peer_set = peer_set . ready ( ) . await ? ; requests . push ( peer_set . call ( zn :: Request :: MempoolTransactionIds ) ) ; } while let Some ( result ) = requests . next ( ) . await { // log individual response errors match result { Ok ( response ) => self . handle_response ( response ) . await ? , // TODO: Reduce the log level of the errors (#2655). Err ( error ) => info ! ( " " error ) , } } Ok ( ( ) ) }
Crawl peers for transactions.
Crawl peers for transactions .
&mut self