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

pub struct BlockHeader {
    pub version: u32,
    pub prev_blockhash: Sha256dHash,
    pub merkle_root: Sha256dHash,
    pub time: u32,
    pub bits: u32,
    pub nonce: u32,
}

A block header, which contains all the block's information except the actual transactions

Fields

The protocol version. Should always be 1.

Reference to the previous block in the chain

The root hash of the merkle tree of transactions in the block

The timestamp of the block, as claimed by the mainer

The target value below which the blockhash must lie, encoded as a a float (with well-defined rounding, of course)

The nonce, selected to obtain a low enough blockhash

Methods

impl BlockHeader
[src]

[src]

Computes the target [0, T] that a blockhash must land in to be valid

[src]

Compute the popular "difficulty" measure for mining

[src]

Performs an SPV validation of a block, which confirms that the proof-of-work is correct, but does not verify that the transactions are valid or encoded correctly.

[src]

Returns the total work of the block

Trait Implementations

impl Copy for BlockHeader
[src]

impl PartialEq for BlockHeader
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for BlockHeader
[src]

impl Clone for BlockHeader
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for BlockHeader
[src]

[src]

Formats the value using the given formatter. Read more

impl BitcoinHash for BlockHeader
[src]

[src]

Produces a Sha256dHash which can be used to refer to the object

impl<S: SimpleEncoder> ConsensusEncodable<S> for BlockHeader
[src]

[src]

Encode an object with a well-defined format

impl<D: SimpleDecoder> ConsensusDecodable<D> for BlockHeader
[src]

[src]

Decode an object with a well-defined format

Auto Trait Implementations

impl Send for BlockHeader

impl Sync for BlockHeader