-
- All Implemented Interfaces:
-
org.bitcoindevkit.Disposable
public final class Header implements Disposable
Bitcoin block header. Contains all the block’s information except the actual transactions, but including a root of a merkle tree committing to all transactions in the block.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classHeader.Companion
-
Field Summary
Fields Modifier and Type Field Description private Integerversionprivate BlockHashprevBlockhashprivate TxMerkleNodemerkleRootprivate UInttimeprivate UIntbitsprivate UIntnonce
-
Method Summary
Modifier and Type Method Description final IntegergetVersion()Block version, now repurposed for soft fork signalling. final UnitsetVersion(Integer version)Block version, now repurposed for soft fork signalling. final BlockHashgetPrevBlockhash()Reference to the previous block in the chain. final UnitsetPrevBlockhash(BlockHash prevBlockhash)Reference to the previous block in the chain. final TxMerkleNodegetMerkleRoot()The root hash of the merkle tree of transactions in the block. final UnitsetMerkleRoot(TxMerkleNode merkleRoot)The root hash of the merkle tree of transactions in the block. final UIntgetTime()The timestamp of the block, as claimed by the miner. final UnitsetTime(UInt time)The timestamp of the block, as claimed by the miner. final UIntgetBits()The target value below which the blockhash must lie. final UnitsetBits(UInt bits)The target value below which the blockhash must lie. final UIntgetNonce()The nonce, selected to obtain a low enough blockhash. final UnitsetNonce(UInt nonce)The nonce, selected to obtain a low enough blockhash. Unitdestroy()-
-
Method Detail
-
getVersion
final Integer getVersion()
Block version, now repurposed for soft fork signalling.
-
setVersion
final Unit setVersion(Integer version)
Block version, now repurposed for soft fork signalling.
-
getPrevBlockhash
final BlockHash getPrevBlockhash()
Reference to the previous block in the chain.
-
setPrevBlockhash
final Unit setPrevBlockhash(BlockHash prevBlockhash)
Reference to the previous block in the chain.
-
getMerkleRoot
final TxMerkleNode getMerkleRoot()
The root hash of the merkle tree of transactions in the block.
-
setMerkleRoot
final Unit setMerkleRoot(TxMerkleNode merkleRoot)
The root hash of the merkle tree of transactions in the block.
-
-
-
-