pub fn start_sign_checker_detached(
    input: mpsc::Receiver<VerifyTxSignatureRequest>,
    eth_watch_req: mpsc::Sender<EthWatchRequest>,
    panic_notify: mpsc::Sender<bool>,
) {
    /// Main signature check requests handler.
    /// Basically it receives the requests through the channel and verifies signatures,
    /// notifying the request sender about the check result.
    async fn checker_routine(
        handle: Handle,
        mut input: mpsc::Receiver<VerifyTxSignatureRequest>,
        eth_watch_req: mpsc::Sender<EthWatchRequest>,
    ) {
        while let Some(request) = input.next().await {
            let eth_watch_req = eth_watch_req.clone();
            handle.spawn(async move {
                let resp = VerifiedTx::verify(&request, eth_watch_req).await;

                request.response.send(resp).unwrap_or_default();
            });
        }
    }

    std::thread::Builder::new()
        .name("Signature checker thread".to_string())
        .spawn(move || {
            let _panic_sentinel = ThreadPanicNotify(panic_notify.clone());

            let mut runtime = Builder::new()
                .enable_all()
                .threaded_scheduler()
                .build()
                .expect("failed to build runtime for signature processor");
            let handle = runtime.handle().clone();
            runtime.block_on(checker_routine(handle, input, eth_watch_req));
        })
        .expect("failed to start signature checker thread");
}
/// Main routine of the concurrent signature checker.
/// See the module documentation for details.
Main routine of the concurrent signature checker.
See the module documentation for details.
Main routine of the concurrent signature checker . See the module documentation for details .
pub fn start_sign_checker_detached(
    input: mpsc::Receiver<VerifyTxSignatureRequest>,
    eth_watch_req: mpsc::Sender<EthWatchRequest>,
    panic_notify: mpsc::Sender<bool>,
) {
    /// Main signature check requests handler.
    /// Basically it receives the requests through the channel and verifies signatures,
    /// notifying the request sender about the check result.
    async fn checker_routine(
        handle: Handle,
        mut input: mpsc::Receiver<VerifyTxSignatureRequest>,
        eth_watch_req: mpsc::Sender<EthWatchRequest>,
    ) {
        while let Some(request) = input.next().await {
            let eth_watch_req = eth_watch_req.clone();
            handle.spawn(async move {
                let resp = VerifiedTx::verify(&request, eth_watch_req).await;
                request.response.send(resp).unwrap_or_default();
            });
        }
    }
    std::thread::Builder::new()
        .name("Signature checker thread".to_string())
        .spawn(move || {
            let _panic_sentinel = ThreadPanicNotify(panic_notify.clone());
            let mut runtime = Builder::new()
                .enable_all()
                .threaded_scheduler()
                .build()
                .expect("failed to build runtime for signature processor");
            let handle = runtime.handle().clone();
            runtime.block_on(checker_routine(handle, input, eth_watch_req));
        })
        .expect("failed to start signature checker thread");
}
pub fn start_sign_checker_detached ( input : mpsc :: Receiver < VerifyTxSignatureRequest > , eth_watch_req : mpsc :: Sender < EthWatchRequest > , panic_notify : mpsc :: Sender < bool > , ) { /// Main signature check requests handler. /// Basically it receives the requests through the channel and verifies signatures, /// notifying the request sender about the check result. async fn checker_routine ( handle : Handle , mut input : mpsc :: Receiver < VerifyTxSignatureRequest > , eth_watch_req : mpsc :: Sender < EthWatchRequest > , ) { while let Some ( request ) = input . next ( ) . await { let eth_watch_req = eth_watch_req . clone ( ) ; handle . spawn ( async move { let resp = VerifiedTx :: verify ( & request , eth_watch_req ) . await ; request . response . send ( resp ) . unwrap_or_default ( ) ; } ) ; } } std :: thread :: Builder :: new ( ) . name ( " " . to_string ( ) ) . spawn ( move | | { let _panic_sentinel = ThreadPanicNotify ( panic_notify . clone ( ) ) ; let mut runtime = Builder :: new ( ) . enable_all ( ) . threaded_scheduler ( ) . build ( ) . expect ( " " ) ; let handle = runtime . handle ( ) . clone ( ) ; runtime . block_on ( checker_routine ( handle , input , eth_watch_req ) ) ; } ) . expect ( " " ) ; }
Main routine of the concurrent signature checker.
Main routine of the concurrent signature checker .
input
mpsc::Receiver<VerifyTxSignatureRequest>
eth_watch_req
mpsc::Sender<EthWatchRequest>
panic_notify
mpsc::Sender<bool>