fn justification_import_result(&mut self, hash: B::Hash, number: NumberFor<B>, success: bool) {
		let request = (hash, number);

		if !self.importing_requests.remove(&request) {
			debug!(target: "sync", "Got justification import result for unknown justification {:?} {:?} request.",
				request.0,
				request.1,
			);

			return;
		};

		if success {
			if self.justifications.finalize_root(&request.0).is_none() {
				warn!(target: "sync", "Imported justification for {:?} {:?} which isn't a root in the tree: {:?}",
					request.0,
					request.1,
					self.justifications.roots().collect::<Vec<_>>(),
				);

				return;
			};

			self.previous_requests.clear();
			self.peer_requests.clear();
			self.pending_requests =
				self.justifications.roots().map(|(h, n, _)| (h.clone(), n.clone())).collect();

			return;
		}
		self.pending_requests.push_front(request);
	}
/// Process the import of a justification.
/// Queues a retry in case the import failed.
Process the import of a justification.
Queues a retry in case the import failed.
Process the import of a justification . Queues a retry in case the import failed .
fn justification_import_result(&mut self, hash: B::Hash, number: NumberFor<B>, success: bool) {
		let request = (hash, number);
		if !self.importing_requests.remove(&request) {
			debug!(target: "sync", "Got justification import result for unknown justification {:?} {:?} request.",
				request.0,
				request.1,
			);
			return;
		};
		if success {
			if self.justifications.finalize_root(&request.0).is_none() {
				warn!(target: "sync", "Imported justification for {:?} {:?} which isn't a root in the tree: {:?}",
					request.0,
					request.1,
					self.justifications.roots().collect::<Vec<_>>(),
				);
				return;
			};
			self.previous_requests.clear();
			self.peer_requests.clear();
			self.pending_requests =
				self.justifications.roots().map(|(h, n, _)| (h.clone(), n.clone())).collect();
			return;
		}
		self.pending_requests.push_front(request);
	}
fn justification_import_result ( & mut self , hash : B :: Hash , number : NumberFor < B > , success : bool ) { let request = ( hash , number ) ; if ! self . importing_requests . remove ( & request ) { debug ! ( target " " " " request 0 request 1 ) ; return ; } ; if success { if self . justifications . finalize_root ( & request . 0 ) . is_none ( ) { warn ! ( target " " " " request 0 request 1 self justifications roots ( ) collect Vec ( ) ) ; return ; } ; self . previous_requests . clear ( ) ; self . peer_requests . clear ( ) ; self . pending_requests = self . justifications . roots ( ) . map ( | ( h , n , _ ) | ( h . clone ( ) , n . clone ( ) ) ) . collect ( ) ; return ; } self . pending_requests . push_front ( request ) ; }
Process the import of a justification.
Process the import of a justification .
&mut self
hash
B::Hash
number
NumberFor<B>
success
bool
&mut self
hash
B::Hash
number
NumberFor<B>
success
bool