BchBlockHeader

Header of a block for bitcoin-family cryptocurrencies

Inheritors

Constructors

Link copied to clipboard
constructor(_hash: Hash256, _version: Int, _time: Long, _diffBits: Long, _nonce: Long, _hashMerkleRoot: Hash256, _hashPrevBlock: Hash256)

assignment constructor

constructor(stream: BCHserialized)
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var chainWork: BigInteger
Link copied to clipboard
open override var diffBits: Long
Link copied to clipboard
open override val hash: Hash256

Return this block's hash. Uses a cached value if one exists. If you change the block be sure to call calcHash() or invalidateHash() to update this value either greedily or lazily respectively

Link copied to clipboard
open override var hashAncestor: Hash256
Link copied to clipboard
Link copied to clipboard
open override var hashMerkleRoot: Hash256
Link copied to clipboard
open override var hashPrevBlock: Hash256
Link copied to clipboard
open override var height: Long
Link copied to clipboard
var nonce: Long
Link copied to clipboard
open override var size: Long
Link copied to clipboard
open override var time: Long
Link copied to clipboard
open override var txCount: Long
Link copied to clipboard
Link copied to clipboard
open val work: BigInteger

Functions

Link copied to clipboard
Link copied to clipboard
open override fun BCHdeserialize(stream: BCHserialized): BCHserialized

Deserializer Note that this includes the number of tx in NETWORK serialization as a legacy of the P2P network protocol. In DISK serialization, the block size in bytes is included.

Link copied to clipboard
open override fun BCHserialize(format: SerializationType): BCHserialized
Link copied to clipboard
Link copied to clipboard
open override fun calcHash(): Hash256

Force recalculation of hash. To access the hash just use #hash

Link copied to clipboard
open override fun changed()

Communicate that this object has been changed, so recalculation of cached data is needed

Link copied to clipboard

Deserialize just the header fields (used when this header is included in other objects/messages

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun toByteArray(format: SerializationType = SerializationType.UNKNOWN): ByteArray
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun validate(cs: ChainSelector): Boolean

run checks (such as verifying POW claim) & return true if the block header is consistent