fn request_headers(
		&mut self,
		peer: Arc<Peer>,
		index: u8,
		peer_count: u8,
		header_cache_size: u64,
	) -> Option<Arc<Peer>> {
		if let Ok(mut locator) = self.get_locator() {
			if header_cache_size > 0 {
				// we insert a final record that indicates which index to use. Ignored by older
				// versions, but understood by current version.
				let mut zero_hash = grin_core::core::hash::ZERO_HASH.to_vec();
				zero_hash[0] = index;
				zero_hash[1] = peer_count;
				locator.push(Hash::from_vec(&zero_hash));
			}
			debug!(
				"sync: request_headers: asking {} for headers, {:?}",
				peer.info.addr, locator,
			);
			let _ = peer.send_header_request(locator);
			return Some(peer.clone());
		}
		return None;
	}
/// Request some block headers from a peer to advance us.
Request some block headers from a peer to advance us.
Request some block headers from a peer to advance us .
fn request_headers(
		&mut self,
		peer: Arc<Peer>,
		index: u8,
		peer_count: u8,
		header_cache_size: u64,
	) -> Option<Arc<Peer>> {
		if let Ok(mut locator) = self.get_locator() {
			if header_cache_size > 0 {
				// we insert a final record that indicates which index to use. Ignored by older
				// versions, but understood by current version.
				let mut zero_hash = grin_core::core::hash::ZERO_HASH.to_vec();
				zero_hash[0] = index;
				zero_hash[1] = peer_count;
				locator.push(Hash::from_vec(&zero_hash));
			}
			debug!(
				"sync: request_headers: asking {} for headers, {:?}",
				peer.info.addr, locator,
			);
			let _ = peer.send_header_request(locator);
			return Some(peer.clone());
		}
		return None;
	}
fn request_headers ( & mut self , peer : Arc < Peer > , index : u8 , peer_count : u8 , header_cache_size : u64 , ) -> Option < Arc < Peer > > { if let Ok ( mut locator ) = self . get_locator ( ) { if header_cache_size > 0 { // we insert a final record that indicates which index to use. Ignored by older // versions, but understood by current version. let mut zero_hash = grin_core :: core :: hash :: ZERO_HASH . to_vec ( ) ; zero_hash [ 0 ] = index ; zero_hash [ 1 ] = peer_count ; locator . push ( Hash :: from_vec ( & zero_hash ) ) ; } debug ! ( " " peer info addr locator ) ; let _ = peer . send_header_request ( locator ) ; return Some ( peer . clone ( ) ) ; } return None ; }
Request some block headers from a peer to advance us.
Request some block headers from a peer to advance us .
&mut self
peer
Arc<Peer>
index
u8
peer_count
u8
header_cache_size
u64
&mut self
peer
Arc<Peer>
index
u8
peer_count
u8
header_cache_size
u64