Improve difficulty rustdocs

Copy a sentence from the `pow::Target::difficulty` function onto the
`block:Header::difficulty` function.
This commit is contained in:
Tobin C. Harding 2023-11-03 11:58:02 +11:00
parent 071208ccdd
commit 62af5b54f3
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,9 @@ impl Header {
pub fn target(&self) -> Target { self.bits.into() } pub fn target(&self) -> Target { self.bits.into() }
/// Computes the popular "difficulty" measure for mining. /// Computes the popular "difficulty" measure for mining.
///
/// Difficulty represents how difficult the current target makes it to find a block, relative to
/// how difficult it would be at the highest possible target (highest target == lowest difficulty).
pub fn difficulty(&self) -> u128 { self.target().difficulty() } pub fn difficulty(&self) -> u128 { self.target().difficulty() }
/// Computes the popular "difficulty" measure for mining and returns a float value of f64. /// Computes the popular "difficulty" measure for mining and returns a float value of f64.