Struct elements::BlockHeader
source · pub struct BlockHeader {
pub version: u32,
pub prev_blockhash: BlockHash,
pub merkle_root: TxMerkleNode,
pub time: u32,
pub height: u32,
pub ext: ExtData,
}
Expand description
Elements block header
Fields§
§version: u32
Version - should be 0x20000000 except when versionbits signalling
prev_blockhash: BlockHash
Previous blockhash
merkle_root: TxMerkleNode
Transaction Merkle root
time: u32
Block timestamp
height: u32
Block height
ext: ExtData
Block signature and dynamic federation-related data
Implementations§
source§impl BlockHeader
impl BlockHeader
sourcepub fn block_hash(&self) -> BlockHash
pub fn block_hash(&self) -> BlockHash
Return the block hash.
sourcepub fn is_dynafed(&self) -> bool
pub fn is_dynafed(&self) -> bool
Returns true if this is a block with dynamic federations enabled.
sourcepub fn clear_witness(&mut self)
pub fn clear_witness(&mut self)
Remove the witness data of the block header. This is all the data that can be removed without changing the block hash.
sourcepub fn calculate_dynafed_params_root(&self) -> Option<Midstate>
pub fn calculate_dynafed_params_root(&self) -> Option<Midstate>
Calculate the root of the dynafed params. Returns None when not dynafed.
sourcepub fn dynafed_current(&self) -> Option<&Params>
pub fn dynafed_current(&self) -> Option<&Params>
Get the current dynafed parameters if it’s a dynafed header.
sourcepub fn dynafed_proposed(&self) -> Option<&Params>
pub fn dynafed_proposed(&self) -> Option<&Params>
Get the proposed dynafed parameters if it’s a dynafed header.
Trait Implementations§
source§impl Clone for BlockHeader
impl Clone for BlockHeader
source§fn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
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 BlockHeader
impl Debug for BlockHeader
source§impl Decodable for BlockHeader
impl Decodable for BlockHeader
source§impl Encodable for BlockHeader
impl Encodable for BlockHeader
source§impl Hash for BlockHeader
impl Hash for BlockHeader
source§impl PartialEq for BlockHeader
impl PartialEq for BlockHeader
source§fn eq(&self, other: &BlockHeader) -> bool
fn eq(&self, other: &BlockHeader) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for BlockHeader
impl StructuralPartialEq for BlockHeader
Auto Trait Implementations§
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnwindSafe for BlockHeader
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