Skip to content

Commit

Permalink
Fix stratum client issue (#3362)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanlee42 authored Apr 22, 2022
1 parent d9e38d1 commit 0203e79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/miner_client/src/stratum_client_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ pub struct StratumClientService {
struct Inner {
request_channel: mpsc::UnboundedReceiver<Request>,
connections: HashMap<String, mpsc::UnboundedSender<StratumJob>>,
stream: Option<Pin<Box<dyn Stream<Item = String>>>>,
stream: Option<Pin<Box<dyn Stream<Item = String> + Send>>>,
pending_requests: HashMap<u32, PendingRequest>,
sink: Pin<Box<dyn Sink<String, Error = anyhow::Error>>>,
sink: Pin<Box<dyn Sink<String, Error = anyhow::Error> + Send>>,
}

impl Inner {
Expand Down Expand Up @@ -261,15 +261,15 @@ impl Inner {
}

impl ActorService for StratumClientService {
fn started(&mut self, ctx: &mut ServiceContext<Self>) -> Result<()> {
fn started(&mut self, _ctx: &mut ServiceContext<Self>) -> Result<()> {
let tcp_stream = TcpStream::from_std(
self.tcp_stream
.take()
.ok_or_else(|| anyhow!("stratum client not got a tcp stream"))?,
)?;
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(())
}
}
Expand Down

0 comments on commit 0203e79

Please sign in to comment.