From b0a1de2b715ddbca0d6ae7a83152f7403e1dd20a Mon Sep 17 00:00:00 2001 From: fikgol Date: Fri, 22 Apr 2022 05:52:23 +0800 Subject: [PATCH] Fix stratum client issue --- cmd/miner_client/src/stratum_client_service.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/miner_client/src/stratum_client_service.rs b/cmd/miner_client/src/stratum_client_service.rs index 2dda8f1c66..aea7377cc5 100644 --- a/cmd/miner_client/src/stratum_client_service.rs +++ b/cmd/miner_client/src/stratum_client_service.rs @@ -153,9 +153,9 @@ pub struct StratumClientService { struct Inner { request_channel: mpsc::UnboundedReceiver, connections: HashMap>, - stream: Option>>>, + stream: Option + Send>>>, pending_requests: HashMap, - sink: Pin>>, + sink: Pin + Send>>, } impl Inner { @@ -261,7 +261,7 @@ impl Inner { } impl ActorService for StratumClientService { - fn started(&mut self, ctx: &mut ServiceContext) -> Result<()> { + fn started(&mut self, _ctx: &mut ServiceContext) -> Result<()> { let tcp_stream = TcpStream::from_std( self.tcp_stream .take() @@ -269,7 +269,7 @@ impl ActorService for StratumClientService { )?; let (inner, sender) = Inner::new(tcp_stream); self.sender = Some(sender); - ctx.spawn(inner.start()); + std::thread::spawn(move || futures::executor::block_on(inner.start())); Ok(()) } }