From df6b94a53bc12d6fdb847bb09f4c84b27c669356 Mon Sep 17 00:00:00 2001 From: plebhash Date: Thu, 1 Aug 2024 14:46:43 -0400 Subject: [PATCH] JDC parse incoming mining messages from upstream after SetupConnection `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") --- roles/jd-client/src/lib/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/jd-client/src/lib/mod.rs b/roles/jd-client/src/lib/mod.rs index 7e2fe7edc..db52a6c39 100644 --- a/roles/jd-client/src/lib/mod.rs +++ b/roles/jd-client/src/lib/mod.rs @@ -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, @@ -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(),