Block

object Block extends BtcSerializer[Block]
Companion:
class
Source:
Block.scala
trait Product
trait Mirror
class Object
trait Matchable
class Any
Block.type

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
Source:
Mirror.scala

The name of the type

The name of the type

Inherited from:
Mirror
Source:
Mirror.scala

Value members

Concrete methods

def blockProof(block: Block): Double

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

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

Returns:

true if the input block validates its expected proof of work

Source:
Block.scala

Checks the witness commitment of a block

Checks the witness commitment of a block

Value parameters:
block

block

Returns:

true if the witness commitment for this block is valid, or if this block does not contain a witness commitment nor any segwit transactions.

Source:
Block.scala
override def read(input: InputStream, protocolVersion: Long): Block

read a message from a stream

read a message from a stream

Value parameters:
in

input stream

Returns:

a deserialized message

Definition Classes
Source:
Block.scala
override def validate(input: Block): Unit
Definition Classes
Source:
Block.scala
Value parameters:
tx

coinbase transaction

Returns:

the witness commitment included in this transaction, if any

Source:
Block.scala
Value parameters:
tx

coinbase transaction

Returns:

the witness reserved value included in the input of this tx if any

Source:
Block.scala
override def write(input: Block, out: OutputStream, protocolVersion: Long): Unit

write a message to a stream

write a message to a stream

Value parameters:
out

output stream

t

message

Definition Classes
Source:
Block.scala

Inherited methods

def read(in: String): T
Inherited from:
BtcSerializer
Source:
Protocol.scala
def read(in: String, protocolVersion: Long): T

read a message from a hex string

read a message from a hex string

Value parameters:
in

message binary data in hex format

Returns:

a deserialized message of type T

Inherited from:
BtcSerializer
Source:
Protocol.scala
def read(in: Array[Byte]): T
Inherited from:
BtcSerializer
Source:
Protocol.scala
def read(in: Array[Byte], protocolVersion: Long): T

read a message from a byte array

read a message from a byte array

Value parameters:
in

serialized message

Returns:

a deserialized message

Inherited from:
BtcSerializer
Source:
Protocol.scala
def read(in: InputStream): T
Inherited from:
BtcSerializer
Source:
Protocol.scala
Inherited from:
BtcSerializer
Source:
Protocol.scala
def write(t: Block, protocolVersion: Long): ByteVector

write a message to a byte array

write a message to a byte array

Value parameters:
t

message

Returns:

a serialized message

Inherited from:
BtcSerializer
Source:
Protocol.scala
def write(t: Block, out: OutputStream): Unit
Inherited from:
BtcSerializer
Source:
Protocol.scala