/// Returns public key of a peer that has required information. Returned key is removed from
/// the corresponding validators list, so next time request will be sent to a different peer.
Returns public key of a peer that has required information. Returned key is removed from
the corresponding validators list, so next time request will be sent to a different peer.
Returns public key of a peer that has required information . Returned key is removed from the corresponding validators list so next time request will be sent to a different peer .
pub(super) fn retry(
        &mut self,
        data: &RequestData,
        peer: Option<PublicKey>,
    ) -> Option<PublicKey> {
        let next = {
            let state = if let Some(state) = self.requests.get_mut(data) {
                state
            } else {
                return None;
            };
            if let Some(peer) = peer {
                state.remove(&peer);
            }
            state.peek()
        };
        if next.is_none() {
            self.requests.remove(data);
        };
        next
    }
pub ( super ) fn retry ( & mut self , data : & RequestData , peer : Option < PublicKey > , ) -> Option < PublicKey > { let next = { let state = if let Some ( state ) = self . requests . get_mut ( data ) { state } else { return None ; } ; if let Some ( peer ) = peer { state . remove ( & peer ) ; } state . peek ( ) } ; if next . is_none ( ) { self . requests . remove ( data ) ; } ; next }
Returns public key of a peer that has required information.
Returns public key of a peer that has required information .
&mut self
data
&RequestData
peer
Option<PublicKey>