improve minimum difficulty handling (#1791)

* rename MIN_DIFFICULTY to UNIT_DIFFICULTY; define Difficulty::unit, fix INITIAL_DIFFICULTY
* improve minimum difficulty handling
* replace all Difficulty::one by ::min
* revert secondary scaling default in HeaderInfo; rename scaling_difficulty; refactor difficulty_data_to_vector
This commit is contained in:
Ignotus Peverell
2018-10-27 10:37:44 -07:00
committed by GitHub
25 changed files with 125 additions and 152 deletions
+3 -3
View File
@@ -509,8 +509,8 @@ pub struct BlockHeaderPrintable {
pub cuckoo_solution: Vec<u64>,
/// Total accumulated difficulty since genesis block
pub total_difficulty: u64,
/// Difficulty scaling factor between the different proofs of work
pub scaling_difficulty: u32,
/// Variable difficulty scaling factor for secondary proof of work
pub secondary_scaling: u32,
/// Total kernel offset since genesis block
pub total_kernel_offset: String,
}
@@ -531,7 +531,7 @@ impl BlockHeaderPrintable {
edge_bits: h.pow.edge_bits(),
cuckoo_solution: h.pow.proof.nonces.clone(),
total_difficulty: h.pow.total_difficulty.to_num(),
scaling_difficulty: h.pow.scaling_difficulty,
secondary_scaling: h.pow.secondary_scaling,
total_kernel_offset: h.total_kernel_offset.to_hex(),
}
}