Companion

object Companion : BtcSerializer<BlockHeader>

Functions

Link copied to clipboard
fun blockProof(header: BlockHeader): UInt256
fun blockProof(bits: Long): UInt256
Link copied to clipboard
fun calculateNextWorkRequired(lastHeader: BlockHeader, lastRetargetTime: Long): Long
Link copied to clipboard
fun checkProofOfWork(header: BlockHeader): Boolean

Proof of work: hash(header) <= target difficulty

Link copied to clipboard
fun getDifficulty(header: BlockHeader): UInt256
Link copied to clipboard
open override fun read(input: ByteArray): BlockHeader
open override fun read(input: String): BlockHeader
fun read(input: Input): BlockHeader

open override fun read(input: Input, protocolVersion: Long): BlockHeader

read a message from a stream

fun read(input: ByteArray, protocolVersion: Long): BlockHeader

read a message from a byte array

fun read(input: String, protocolVersion: Long): BlockHeader

read a message from a hex string

Link copied to clipboard
open fun validate(message: BlockHeader)
Link copied to clipboard
open override fun write(message: BlockHeader): ByteArray
fun write(message: BlockHeader, out: Output)

fun write(message: BlockHeader, protocolVersion: Long): ByteArray

write a message to a byte array

open override fun write(    message: BlockHeader,     output: Output,     protocolVersion: Long)

write a message to a stream