Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce values to make the block's hash satisfy proof‐of‐work requirements. When they solve the proof‐of‐work, they broadcast the block to everyone and the block is added to the block chain. The first transaction in the block is a special one that creates a new coin owned by the creator of the block.
Synopsis
Declared in <primitives/block.h>
class CBlockHeader;
Member Functions
Name |
Description |
|
Constructs a null block header. |
Returns the block creation time. |
|
Computes the block hash by hashing the serialized header. |
|
Returns true when the header has no proof‐of‐work target set. |
|
Resets all header fields to their null state. |
|
Returns the block time as a chrono time point. |
Data Members
Name |
Description |
Merkle root of the transactions in the block. |
|
Hash of the previous block header in the chain. |
|
Compact representation of the proof‐of‐work difficulty target. |
|
Nonce varied during mining to satisfy the proof‐of‐work target. |
|
Block creation time, as a Unix timestamp in seconds. |
|
Block version number, signaling supported consensus rules. |
Non-Member Functions
Name |
Description |
Decode a hex‐encoded serialized block header. |
|
Compute how much work a block header corresponds to. |
|
Update a block header's time field and return the new time. |