fn download_unknown_stale(&mut self, protocol: &mut Context<B>, who: PeerId, hash: &B::Hash) {
		if let Some(ref mut peer) = self.peers.get_mut(&who) {
			match peer.state {
				PeerSyncState::Available => {
					let request = message::generic::BlockRequest {
						id: 0,
						fields: self.required_block_attributes.clone(),
						from: message::FromBlock::Hash(*hash),
						to: None,
						direction: message::Direction::Descending,
						max: Some(MAX_UNKNOWN_FORK_DOWNLOAD_LEN),
					};
					peer.state = PeerSyncState::DownloadingStale(*hash);
					protocol.send_block_request(who, request);
				},
				_ => (),
			}
		}
	}
// Download old block with unknown parent.
Download old block with unknown parent.
Download old block with unknown parent .
fn download_unknown_stale(&mut self, protocol: &mut Context<B>, who: PeerId, hash: &B::Hash) {
		if let Some(ref mut peer) = self.peers.get_mut(&who) {
			match peer.state {
				PeerSyncState::Available => {
					let request = message::generic::BlockRequest {
						id: 0,
						fields: self.required_block_attributes.clone(),
						from: message::FromBlock::Hash(*hash),
						to: None,
						direction: message::Direction::Descending,
						max: Some(MAX_UNKNOWN_FORK_DOWNLOAD_LEN),
					};
					peer.state = PeerSyncState::DownloadingStale(*hash);
					protocol.send_block_request(who, request);
				},
				_ => (),
			}
		}
	}
fn download_unknown_stale ( & mut self , protocol : & mut Context < B > , who : PeerId , hash : & B :: Hash ) { if let Some ( ref mut peer ) = self . peers . get_mut ( & who ) { match peer . state { PeerSyncState :: Available => { let request = message :: generic :: BlockRequest { id : 0 , fields : self . required_block_attributes . clone ( ) , from : message :: FromBlock :: Hash ( * hash ) , to : None , direction : message :: Direction :: Descending , max : Some ( MAX_UNKNOWN_FORK_DOWNLOAD_LEN ) , } ; peer . state = PeerSyncState :: DownloadingStale ( * hash ) ; protocol . send_block_request ( who , request ) ; } , _ => ( ) , } } }
Download old block with unknown parent.
Download old block with unknown parent .
&mut self
protocol
&mut Context<B>
who
PeerId
hash
&B::Hash
&mut self
protocol
&mut Context<B>
who
PeerId
hash
&B::Hash