Skip to content

Commit

Permalink
JDC parse incoming mining messages from upstream after SetupConnection
Browse files Browse the repository at this point in the history
`Upstream::parse_incoming` only calls `handle_message_mining`, which is not able to handle a `SetupConnection.Success` (because it belongs to the "Common Messages" category, not "Mining Messages")
  • Loading branch information
plebhash committed Aug 1, 2024
1 parent d495151 commit 1e8aca8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions roles/jd-client/src/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,6 @@ impl JobDeclaratorClient {
}
};

// Start receiving messages from the SV2 Upstream role
if let Err(e) = upstream_sv2::Upstream::parse_incoming(upstream.clone()) {
error!("failed to create sv2 parser: {}", e);
panic!()
}

match upstream_sv2::Upstream::setup_connection(
upstream.clone(),
proxy_config.min_supported_version,
Expand All @@ -281,6 +275,12 @@ impl JobDeclaratorClient {
}
}

// Start receiving messages from the SV2 Upstream role
if let Err(e) = upstream_sv2::Upstream::parse_incoming(upstream.clone()) {
error!("failed to create sv2 parser: {}", e);
panic!()
}

// Format `Downstream` connection address
let downstream_addr = SocketAddr::new(
IpAddr::from_str(&proxy_config.downstream_address).unwrap(),
Expand Down

0 comments on commit 1e8aca8

Please sign in to comment.