pub enum DiskBlockHeader {
FullyValid(Header, u32),
AssumedValid(Header, u32),
Orphan(Header),
HeadersOnly(Header, u32),
InFork(Header, u32),
InvalidChain(Header),
}
Variants§
FullyValid(Header, u32)
AssumedValid(Header, u32)
Orphan(Header)
HeadersOnly(Header, u32)
InFork(Header, u32)
InvalidChain(Header)
Implementations§
Methods from Deref<Target = BlockHeader>§
pub const SIZE: usize = 80usize
sourcepub fn block_hash(&self) -> BlockHash
pub fn block_hash(&self) -> BlockHash
Returns the block hash.
sourcepub fn target(&self) -> Target
pub fn target(&self) -> Target
Computes the target (range [0, T] inclusive) that a blockhash must land in to be valid.
sourcepub fn difficulty(&self) -> u128
pub fn difficulty(&self) -> u128
Computes the popular “difficulty” measure for mining.
sourcepub fn difficulty_float(&self) -> f64
pub fn difficulty_float(&self) -> f64
Computes the popular “difficulty” measure for mining and returns a float value of f64.
sourcepub fn validate_pow(
&self,
required_target: Target
) -> Result<BlockHash, ValidationError>
pub fn validate_pow( &self, required_target: Target ) -> Result<BlockHash, ValidationError>
Checks that the proof-of-work for the block is valid, returning the block hash.
Trait Implementations§
source§impl Clone for DiskBlockHeader
impl Clone for DiskBlockHeader
source§fn clone(&self) -> DiskBlockHeader
fn clone(&self) -> DiskBlockHeader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DiskBlockHeader
impl Debug for DiskBlockHeader
source§impl Decodable for DiskBlockHeader
impl Decodable for DiskBlockHeader
source§impl Deref for DiskBlockHeader
impl Deref for DiskBlockHeader
source§impl Encodable for DiskBlockHeader
impl Encodable for DiskBlockHeader
impl Copy for DiskBlockHeader
Auto Trait Implementations§
impl RefUnwindSafe for DiskBlockHeader
impl Send for DiskBlockHeader
impl Sync for DiskBlockHeader
impl Unpin for DiskBlockHeader
impl UnwindSafe for DiskBlockHeader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more