Struct grin_core::pow::ProofOfWork
source · pub struct ProofOfWork {
pub total_difficulty: Difficulty,
pub secondary_scaling: u32,
pub nonce: u64,
pub proof: Proof,
}
Expand description
Block header information pertaining to the proof of work
Fields§
§total_difficulty: Difficulty
Total accumulated difficulty since genesis block
secondary_scaling: u32
Variable difficulty scaling factor fo secondary proof of work After HardFork4, which obsoletes secondary PoW, this effectively becomes 4 more bytes of nonce. might be repurposed in future.
nonce: u64
Nonce increment used to mine this block.
proof: Proof
Proof of work data.
Implementations§
source§impl ProofOfWork
impl ProofOfWork
sourcepub fn write_pre_pow<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
pub fn write_pre_pow<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Write the pre-hash portion of the header
sourcepub fn to_difficulty(&self, height: u64) -> Difficulty
pub fn to_difficulty(&self, height: u64) -> Difficulty
Maximum difficulty this proof of work can achieve
sourcepub fn to_unscaled_difficulty(&self) -> Difficulty
pub fn to_unscaled_difficulty(&self) -> Difficulty
Maximum unscaled difficulty this proof of work can achieve
sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
Whether this proof of work is for the primary algorithm (as opposed to secondary). Only depends on the edge_bits at this time.
sourcepub fn is_secondary(&self) -> bool
pub fn is_secondary(&self) -> bool
Whether this proof of work is for the secondary algorithm (as opposed to primary). Only depends on the edge_bits at this time.
Trait Implementations§
source§impl Clone for ProofOfWork
impl Clone for ProofOfWork
source§fn clone(&self) -> ProofOfWork
fn clone(&self) -> ProofOfWork
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProofOfWork
impl Debug for ProofOfWork
source§impl Default for ProofOfWork
impl Default for ProofOfWork
source§fn default() -> ProofOfWork
fn default() -> ProofOfWork
source§impl PartialEq for ProofOfWork
impl PartialEq for ProofOfWork
source§fn eq(&self, other: &ProofOfWork) -> bool
fn eq(&self, other: &ProofOfWork) -> bool
self
and other
values to be equal, and is used
by ==
.