diff --git a/miner-api/src/lib.rs b/miner-api/src/lib.rs index 6c15fc34..5e540991 100644 --- a/miner-api/src/lib.rs +++ b/miner-api/src/lib.rs @@ -83,8 +83,8 @@ pub struct MiningRequest { pub job_id: String, /// Hex encoded header hash (32 bytes -> 64 chars, no 0x prefix) pub mining_hash: String, - /// Distance threshold (U512 as decimal string) - pub distance_threshold: String, + /// Difficulty (U512 as decimal string). Must be non-zero. + pub difficulty: String, } /// Response payload for job submission (`/mine`) and cancellation (`/cancel`). diff --git a/node/src/service.rs b/node/src/service.rs index 3867262a..13965cad 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -175,11 +175,8 @@ async fn handle_external_mining( mining_hash, difficulty ); - let job = MiningRequest { - job_id: job_id.clone(), - mining_hash, - distance_threshold: difficulty.to_string(), - }; + let job = + MiningRequest { job_id: job_id.clone(), mining_hash, difficulty: difficulty.to_string() }; server.broadcast_job(job).await; diff --git a/primitives/consensus/qpow/src/lib.rs b/primitives/consensus/qpow/src/lib.rs index 6e38f6b8..28080664 100644 --- a/primitives/consensus/qpow/src/lib.rs +++ b/primitives/consensus/qpow/src/lib.rs @@ -16,7 +16,7 @@ sp_api::decl_runtime_apis! { /// Get the max possible difficulty for work calculation fn get_max_difficulty() -> U512; - /// Get the current difficulty (max_distance / distance_threshold) + /// Get the current mining difficulty fn get_difficulty() -> U512; /// Get last block timestamp