fn pull_blocks_to_tip(&mut self, req: ChainPullRequest<HeaderHash>) {
        let block_box = self.block_sink.message_box();
        let logger = self.logger.clone();
        let err_logger = logger.clone();
        self.global_state.spawn(
            self.service
                .pull_blocks_to_tip(&req.from)
                .map_err(move |e| {
                    info!(err_logger, "PullBlocksToTip request failed: {:?}", e);
                })
                .and_then(move |stream| {
                    let stream_err_logger = logger.clone();
                    let sink_err_logger = logger.clone();
                    let stream = stream.map_err(move |e| {
                        info!(
                            stream_err_logger,
                            "PullBlocksToTip response stream failed: {:?}", e
                        );
                    });
                    InboundProcessing::with_unary(
                        block_box.clone(),
                        logger.clone(),
                        |block, reply| BlockMsg::NetworkBlock(block, reply),
                    )
                    .sink_map_err(move |e| {
                        warn!(sink_err_logger, "pulled block validation failed: {:?}", e)
                    })
                    .send_all(stream)
                    .map(move |_| {
                        debug!(logger, "PullBlocksToTip response processed");
                    })
                }),
        );
    }
// Temporary support for pulling chain blocks without two-stage
// retrieval.
Temporary support for pulling chain blocks without two-stage
retrieval.
Temporary support for pulling chain blocks without two - stage retrieval .
fn pull_blocks_to_tip(&mut self, req: ChainPullRequest<HeaderHash>) {
        let block_box = self.block_sink.message_box();
        let logger = self.logger.clone();
        let err_logger = logger.clone();
        self.global_state.spawn(
            self.service
                .pull_blocks_to_tip(&req.from)
                .map_err(move |e| {
                    info!(err_logger, "PullBlocksToTip request failed: {:?}", e);
                })
                .and_then(move |stream| {
                    let stream_err_logger = logger.clone();
                    let sink_err_logger = logger.clone();
                    let stream = stream.map_err(move |e| {
                        info!(
                            stream_err_logger,
                            "PullBlocksToTip response stream failed: {:?}", e
                        );
                    });
                    InboundProcessing::with_unary(
                        block_box.clone(),
                        logger.clone(),
                        |block, reply| BlockMsg::NetworkBlock(block, reply),
                    )
                    .sink_map_err(move |e| {
                        warn!(sink_err_logger, "pulled block validation failed: {:?}", e)
                    })
                    .send_all(stream)
                    .map(move |_| {
                        debug!(logger, "PullBlocksToTip response processed");
                    })
                }),
        );
    }
fn pull_blocks_to_tip ( & mut self , req : ChainPullRequest < HeaderHash > ) { let block_box = self . block_sink . message_box ( ) ; let logger = self . logger . clone ( ) ; let err_logger = logger . clone ( ) ; self . global_state . spawn ( self . service . pull_blocks_to_tip ( & req . from ) . map_err ( move | e | { info ! ( err_logger " " e ) ; } ) . and_then ( move | stream | { let stream_err_logger = logger . clone ( ) ; let sink_err_logger = logger . clone ( ) ; let stream = stream . map_err ( move | e | { info ! ( stream_err_logger " " e ) ; } ) ; InboundProcessing :: with_unary ( block_box . clone ( ) , logger . clone ( ) , | block , reply | BlockMsg :: NetworkBlock ( block , reply ) , ) . sink_map_err ( move | e | { warn ! ( sink_err_logger " " e ) } ) . send_all ( stream ) . map ( move | _ | { debug ! ( logger " " ) ; } ) } ) , ) ; }
Temporary support for pulling chain blocks without two-stage
retrieval.
Temporary support for pulling chain blocks without two - stage retrieval .
&mut self
req
ChainPullRequest<HeaderHash>
&mut self
req
ChainPullRequest<HeaderHash>