Struct lightning_block_sync::poll::ValidatedBlock
source · [−]pub struct ValidatedBlock { /* private fields */ }
Expand description
A block with validated data against its transaction list and corresponding block hash.
Methods from Deref<Target = Block>
sourcepub fn block_hash(&self) -> BlockHash
pub fn block_hash(&self) -> BlockHash
Return the block hash.
sourcepub fn check_merkle_root(&self) -> bool
pub fn check_merkle_root(&self) -> bool
check if merkle root of header matches merkle root of the transaction list
sourcepub fn check_witness_commitment(&self) -> bool
pub fn check_witness_commitment(&self) -> bool
check if witness commitment in coinbase is matching the transaction list
sourcepub fn merkle_root(&self) -> TxMerkleNode
pub fn merkle_root(&self) -> TxMerkleNode
Calculate the transaction merkle root.
sourcepub fn witness_root(&self) -> WitnessMerkleNode
pub fn witness_root(&self) -> WitnessMerkleNode
Merkle root of transactions hashed for witness
sourcepub fn get_weight(&self) -> usize
pub fn get_weight(&self) -> usize
Get the weight of the block
sourcepub fn coinbase(&self) -> Option<&Transaction>
pub fn coinbase(&self) -> Option<&Transaction>
Get the coinbase transaction, if one is present.
sourcepub fn bip34_block_height(&self) -> Result<u64, Bip34Error>
pub fn bip34_block_height(&self) -> Result<u64, Bip34Error>
Get the block height as encoded into the coinbase according to BIP34. Returns None if not present.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ValidatedBlock
impl Send for ValidatedBlock
impl Sync for ValidatedBlock
impl Unpin for ValidatedBlock
impl UnwindSafe for ValidatedBlock
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more