pub fn received_getheaders<T: BlockTree>(
        &self,
        addr: &PeerId,
        (locator_hashes, stop_hash): Locators,
        tree: &T,
    ) {
        let max = self.config.max_message_headers;

        if self.is_syncing() || max == 0 {
            return;
        }
        let headers = tree.locate_headers(&locator_hashes, stop_hash, max);

        if headers.is_empty() {
            return;
        }
        self.upstream.send_headers(*addr, headers);
    }
/// Called when we received a `getheaders` message from a peer.
Called when we received a `getheaders` message from a peer.
Called when we received a ` getheaders ` message from a peer .
pub fn received_getheaders<T: BlockTree>(
        &self,
        addr: &PeerId,
        (locator_hashes, stop_hash): Locators,
        tree: &T,
    ) {
        let max = self.config.max_message_headers;
        if self.is_syncing() || max == 0 {
            return;
        }
        let headers = tree.locate_headers(&locator_hashes, stop_hash, max);
        if headers.is_empty() {
            return;
        }
        self.upstream.send_headers(*addr, headers);
    }
pub fn received_getheaders < T : BlockTree > ( & self , addr : & PeerId , ( locator_hashes , stop_hash ) : Locators , tree : & T , ) { let max = self . config . max_message_headers ; if self . is_syncing ( ) || max == 0 { return ; } let headers = tree . locate_headers ( & locator_hashes , stop_hash , max ) ; if headers . is_empty ( ) { return ; } self . upstream . send_headers ( * addr , headers ) ; }
Called when we received a `getheaders` message from a peer.
Called when we received a ` getheaders ` message from a peer .
&self
addr
Locators
tree
&T