pub fn peer_negotiated<T: BlockTree>(
        &mut self,
        id: PeerId,
        height: Height,
        services: ServiceFlags,
        link: Link,
        clock: &impl Clock,
        tree: &T,
    ) {
        if !link.is_outbound() {
            return;
        }
        if !services.has(REQUIRED_SERVICES) {
            return;
        }
        let time = clock.local_time();

        self.peers.insert(
            id,
            Peer {
                last_active: time,
                height,
            },
        );
        self.sync(tree, time);
    }
/// Called when a new peer was negotiated.
Called when a new peer was negotiated.
Called when a new peer was negotiated .
pub fn peer_negotiated<T: BlockTree>(
        &mut self,
        id: PeerId,
        height: Height,
        services: ServiceFlags,
        link: Link,
        clock: &impl Clock,
        tree: &T,
    ) {
        if !link.is_outbound() {
            return;
        }
        if !services.has(REQUIRED_SERVICES) {
            return;
        }
        let time = clock.local_time();
        self.peers.insert(
            id,
            Peer {
                last_active: time,
                height,
            },
        );
        self.sync(tree, time);
    }
pub fn peer_negotiated < T : BlockTree > ( & mut self , id : PeerId , height : Height , services : ServiceFlags , link : Link , clock : & impl Clock , tree : & T , ) { if ! link . is_outbound ( ) { return ; } if ! services . has ( REQUIRED_SERVICES ) { return ; } let time = clock . local_time ( ) ; self . peers . insert ( id , Peer { last_active : time , height , } , ) ; self . sync ( tree , time ) ; }
Called when a new peer was negotiated.
Called when a new peer was negotiated .
&mut self
id
PeerId
height
Height
services
ServiceFlags
link
Link
clock
&impl Clock
tree
&T