Add blockfound response in stratum (#1245)

* Add blockfound response in stratum
This commit is contained in:
Quentin Le Sceller 2018-07-11 09:17:24 -07:00 committed by GitHub
parent 708afdbbb6
commit 83be242fdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -576,7 +576,13 @@ impl StratumServer {
submitted_by, submitted_by,
); );
worker_stats.num_accepted += 1; worker_stats.num_accepted += 1;
return Ok((serde_json::to_value("ok".to_string()).unwrap(), share_is_block)); let submit_response;
if share_is_block {
submit_response = format!("blockfound - {}", b.hash().to_hex());
} else {
submit_response = "ok".to_string();
}
return Ok((serde_json::to_value(submit_response).unwrap(), share_is_block));
} // handle submit a solution } // handle submit a solution
// Purge dead/sick workers - remove all workers marked in error state // Purge dead/sick workers - remove all workers marked in error state