Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions miner-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
Expand Down
7 changes: 2 additions & 5 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion primitives/consensus/qpow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading