Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue where JDC stops receiving shares after rapid block succession #1146

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions roles/jd-client/src/lib/downstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,22 @@ impl DownstreamMiningNode {
// pool's job_id. The below return as soon as we have a pairable job id for the
// template_id associated with this share.
let last_template_id = self_mutex.safe_lock(|s| s.last_template_id).unwrap();
// Await the job ID associated with the template, with a timeout
let job_id_future =
UpstreamMiningNode::get_job_id(&upstream_mutex, last_template_id);
let job_id = match timeout(Duration::from_secs(10), job_id_future).await {
Ok(job_id) => job_id,
Err(_) => {
// Handle timeout or failure to get job ID
warn!(
"Failed to retrieve job_id for last_template_id: {}",
last_template_id
);
return;
}
};

// Assign the job ID to the share and send it upstream
share.job_id = job_id;
debug!(
"Sending valid block solution upstream, with job_id {}",
Expand Down
Loading