pub(crate) fn check_timeout(&mut self, data_id: &T, peer: NodeId) -> GossipAction {
        let update = |state: &mut State| {
            debug_assert!(
                state.held_by_us,
                "shouldn't check timeout for a gossip response for partial data"
            );
            if !state.held_by_us {
                error!(
                    item=%data_id,
                    %peer, "shouldn't check timeout for a gossip response for partial data"
                );
                return;
            }

            if !state.holders.contains(&peer) {
                // Add the peer as a holder just to avoid retrying it.
                let _ = state.holders.insert(peer);
                state.in_flight_count = state.in_flight_count.saturating_sub(1);
            }
        };

        self.update_current(data_id, update)
            .unwrap_or(GossipAction::Noop)
    }
/// Checks if gossip request we sent timed out.
///
/// If the peer is already counted as a holder, it has previously responded and this method
/// returns Noop.  Otherwise it has timed out and we return the appropriate action to take.
Checks if gossip request we sent timed out.
If the peer is already counted as a holder, it has previously responded and this method
returns Noop.  Otherwise it has timed out and we return the appropriate action to take.
Checks if gossip request we sent timed out . If the peer is already counted as a holder it has previously responded and this method returns Noop . Otherwise it has timed out and we return the appropriate action to take .
pub(crate) fn check_timeout(&mut self, data_id: &T, peer: NodeId) -> GossipAction {
        let update = |state: &mut State| {
            debug_assert!(
                state.held_by_us,
                "shouldn't check timeout for a gossip response for partial data"
            );
            if !state.held_by_us {
                error!(
                    item=%data_id,
                    %peer, "shouldn't check timeout for a gossip response for partial data"
                );
                return;
            }
            if !state.holders.contains(&peer) {
                // Add the peer as a holder just to avoid retrying it.
                let _ = state.holders.insert(peer);
                state.in_flight_count = state.in_flight_count.saturating_sub(1);
            }
        };
        self.update_current(data_id, update)
            .unwrap_or(GossipAction::Noop)
    }
pub ( crate ) fn check_timeout ( & mut self , data_id : & T , peer : NodeId ) -> GossipAction { let update = | state : & mut State | { debug_assert ! ( state held_by_us " " ) ; if ! state . held_by_us { error ! ( item data_id peer " " ) ; return ; } if ! state . holders . contains ( & peer ) { // Add the peer as a holder just to avoid retrying it. let _ = state . holders . insert ( peer ) ; state . in_flight_count = state . in_flight_count . saturating_sub ( 1 ) ; } } ; self . update_current ( data_id , update ) . unwrap_or ( GossipAction :: Noop ) }
Checks if gossip request we sent timed out.
Checks if gossip request we sent timed out .
&mut self
data_id
&T
peer
NodeId
&mut self
data_id
&T
peer
NodeId