fn recv_missing_blocks(&mut self, query: Header, missing: Vec<Cid>) {
        let mut num_missing = 0;
        let num_missing_ref = &mut num_missing;
        self.sync_query(query.parent.unwrap(), |mgr, parent, mut state| {
            state.children.remove(&query.id);
            for cid in missing {
                state.missing.insert(mgr.get(
                    Some(parent.root),
                    cid,
                    state.providers.iter().copied(),
                ));
            }
            *num_missing_ref = state.missing.len();
            if state.missing.is_empty() && state.children.is_empty() {
                Transition::Complete(Ok(()))
            } else {
                Transition::Next(state)
            }
        });
        if num_missing != 0 {
            self.events
                .push_back(QueryEvent::Progress(query.root, num_missing));
        }
    }
/// Processes the response of a missing blocks query.
///
/// Starts a get query for each missing block. If there are no in progress queries
/// the sync query is marked as complete.
Processes the response of a missing blocks query.
Starts a get query for each missing block. If there are no in progress queries
the sync query is marked as complete.
Processes the response of a missing blocks query . Starts a get query for each missing block . If there are no in progress queries the sync query is marked as complete .
fn recv_missing_blocks(&mut self, query: Header, missing: Vec<Cid>) {
        let mut num_missing = 0;
        let num_missing_ref = &mut num_missing;
        self.sync_query(query.parent.unwrap(), |mgr, parent, mut state| {
            state.children.remove(&query.id);
            for cid in missing {
                state.missing.insert(mgr.get(
                    Some(parent.root),
                    cid,
                    state.providers.iter().copied(),
                ));
            }
            *num_missing_ref = state.missing.len();
            if state.missing.is_empty() && state.children.is_empty() {
                Transition::Complete(Ok(()))
            } else {
                Transition::Next(state)
            }
        });
        if num_missing != 0 {
            self.events
                .push_back(QueryEvent::Progress(query.root, num_missing));
        }
    }
fn recv_missing_blocks ( & mut self , query : Header , missing : Vec < Cid > ) { let mut num_missing = 0 ; let num_missing_ref = & mut num_missing ; self . sync_query ( query . parent . unwrap ( ) , | mgr , parent , mut state | { state . children . remove ( & query . id ) ; for cid in missing { state . missing . insert ( mgr . get ( Some ( parent . root ) , cid , state . providers . iter ( ) . copied ( ) , ) ) ; } * num_missing_ref = state . missing . len ( ) ; if state . missing . is_empty ( ) && state . children . is_empty ( ) { Transition :: Complete ( Ok ( ( ) ) ) } else { Transition :: Next ( state ) } } ) ; if num_missing != 0 { self . events . push_back ( QueryEvent :: Progress ( query . root , num_missing ) ) ; } }
Processes the response of a missing blocks query.
Processes the response of a missing blocks query .
&mut self
query
Header
missing
Vec<Cid>
&mut self
query
Header
missing
Vec<Cid>