async fn request_header<B: BlockchainBackend + 'static>(
    shared: &mut BaseNodeStateMachine<B>,
    sync_peers: &mut SyncPeers,
    height: u64,
) -> Result<(BlockHeader, SyncPeer), BlockSyncError>
{
    let (headers, sync_peer) = request_headers(
        LOG_TARGET,
        shared,
        sync_peers,
        &[height],
        shared.config.block_sync_config.max_header_request_retry_attempts,
    )
    .await?;
    if let Some(header) = headers.first() {
        return Ok((header.clone(), sync_peer));
    }
    Err(BlockSyncError::MaxRequestAttemptsReached)
}
// Request a header from a remote sync peer.
Request a header from a remote sync peer.
Request a header from a remote sync peer .
async fn request_header<B: BlockchainBackend + 'static>(
    shared: &mut BaseNodeStateMachine<B>,
    sync_peers: &mut SyncPeers,
    height: u64,
) -> Result<(BlockHeader, SyncPeer), BlockSyncError>
{
    let (headers, sync_peer) = request_headers(
        LOG_TARGET,
        shared,
        sync_peers,
        &[height],
        shared.config.block_sync_config.max_header_request_retry_attempts,
    )
    .await?;
    if let Some(header) = headers.first() {
        return Ok((header.clone(), sync_peer));
    }
    Err(BlockSyncError::MaxRequestAttemptsReached)
}
async fn request_header < B : BlockchainBackend + ' static > ( shared : & mut BaseNodeStateMachine < B > , sync_peers : & mut SyncPeers , height : u64 , ) -> Result < ( BlockHeader , SyncPeer ) , BlockSyncError > { let ( headers , sync_peer ) = request_headers ( LOG_TARGET , shared , sync_peers , & [ height ] , shared . config . block_sync_config . max_header_request_retry_attempts , ) . await ? ; if let Some ( header ) = headers . first ( ) { return Ok ( ( header . clone ( ) , sync_peer ) ) ; } Err ( BlockSyncError :: MaxRequestAttemptsReached ) }
Request a header from a remote sync peer.
Request a header from a remote sync peer .
shared
&mut BaseNodeStateMachine<B>
sync_peers
&mut SyncPeers
height
u64
shared
&mut BaseNodeStateMachine<B>
sync_peers
&mut SyncPeers
height
u64