Struct bitcoin::blockdata::block::Block[][src]

pub struct Block {
    pub header: BlockHeader,
    pub txdata: Vec<Transaction>,
}
Expand description

A Bitcoin block, which is a collection of transactions with an attached proof of work.

Fields

header: BlockHeader

The block header

txdata: Vec<Transaction>

List of transactions contained in the block

Implementations

Return the block hash.

check if merkle root of header matches merkle root of the transaction list

check if witness commitment in coinbase is matching the transaction list

Calculate the transaction merkle root.

compute witness commitment for the transaction list

Merkle root of transactions hashed for witness

Get the size of the block

Get the weight of the block

Get the coinbase transaction, if one is present.

Get the block height as encoded into the coinbase according to BIP34. Returns None if not present.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Decode an object with a well-defined format

Encode an object with a well-defined format. Returns the number of bytes written on success. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.