fn on_response(
		&mut self,
		who: PeerId,
		justification: Option<Justification>,
		import_queue: &ImportQueue<B>,
	) {
		// we assume that the request maps to the given response, this is
		// currently enforced by the outer network protocol before passing on
		// messages to chain sync.
		if let Some(request) = self.peer_requests.remove(&who) {
			if let Some(justification) = justification {
				import_queue.import_justification(who.clone(), request.0, request.1, justification);
				self.importing_requests.insert(request);
				return
			}

			self.previous_requests
				.entry(request)
				.or_insert(Vec::new())
				.push((who, Instant::now()));

			self.pending_requests.push_front(request);
		}
	}
/// Processes the response for the request previously sent to the given
/// peer. Queues a retry in case the given justification
/// was `None`.
Processes the response for the request previously sent to the given
peer. Queues a retry in case the given justification
was `None`.
Processes the response for the request previously sent to the given peer . Queues a retry in case the given justification was ` None ` .
fn on_response(
		&mut self,
		who: PeerId,
		justification: Option<Justification>,
		import_queue: &ImportQueue<B>,
	) {
		// we assume that the request maps to the given response, this is
		// currently enforced by the outer network protocol before passing on
		// messages to chain sync.
		if let Some(request) = self.peer_requests.remove(&who) {
			if let Some(justification) = justification {
				import_queue.import_justification(who.clone(), request.0, request.1, justification);
				self.importing_requests.insert(request);
				return
			}
			self.previous_requests
				.entry(request)
				.or_insert(Vec::new())
				.push((who, Instant::now()));
			self.pending_requests.push_front(request);
		}
	}
fn on_response ( & mut self , who : PeerId , justification : Option < Justification > , import_queue : & ImportQueue < B > , ) { // we assume that the request maps to the given response, this is // currently enforced by the outer network protocol before passing on // messages to chain sync. if let Some ( request ) = self . peer_requests . remove ( & who ) { if let Some ( justification ) = justification { import_queue . import_justification ( who . clone ( ) , request . 0 , request . 1 , justification ) ; self . importing_requests . insert ( request ) ; return } self . previous_requests . entry ( request ) . or_insert ( Vec :: new ( ) ) . push ( ( who , Instant :: now ( ) ) ) ; self . pending_requests . push_front ( request ) ; } }
Processes the response for the request previously sent to the given
peer.
Processes the response for the request previously sent to the given peer .
&mut self
who
PeerId
justification
Option<Justification>
import_queue
&ImportQueue<B>
&mut self
who
PeerId
justification
Option<Justification>
import_queue
&ImportQueue<B>