fn sample_peers<T: BlockTree>(&mut self, now: LocalTime, tree: &T) {
        let locators = tree.locator_hashes(tree.height());
        let addrs = self
            .peers
            .values()
            .filter(|p| self.is_sync_candidate(p, &locators, tree))
            .map(|p| p.id)
            .collect::<Vec<_>>();

        for addr in addrs {
            self.request(
                addr,
                (locators.clone(), BlockHash::default()),
                now,
                self.config.request_timeout,
                OnTimeout::Ignore,
            );
        }
    }
/// Ask all our outbound peers whether they have better block headers.
Ask all our outbound peers whether they have better block headers.
Ask all our outbound peers whether they have better block headers .
fn sample_peers<T: BlockTree>(&mut self, now: LocalTime, tree: &T) {
        let locators = tree.locator_hashes(tree.height());
        let addrs = self
            .peers
            .values()
            .filter(|p| self.is_sync_candidate(p, &locators, tree))
            .map(|p| p.id)
            .collect::<Vec<_>>();
        for addr in addrs {
            self.request(
                addr,
                (locators.clone(), BlockHash::default()),
                now,
                self.config.request_timeout,
                OnTimeout::Ignore,
            );
        }
    }
fn sample_peers < T : BlockTree > ( & mut self , now : LocalTime , tree : & T ) { let locators = tree . locator_hashes ( tree . height ( ) ) ; let addrs = self . peers . values ( ) . filter ( | p | self . is_sync_candidate ( p , & locators , tree ) ) . map ( | p | p . id ) . collect :: < Vec < _ > > ( ) ; for addr in addrs { self . request ( addr , ( locators . clone ( ) , BlockHash :: default ( ) ) , now , self . config . request_timeout , OnTimeout :: Ignore , ) ; } }
Ask all our outbound peers whether they have better block headers.
Ask all our outbound peers whether they have better block headers .
&mut self
now
LocalTime
tree
&T