MsgHeaders class

MsgHeaders implements the Message interface and represents a bitcoin headers message. It is used to deliver block header information in response to a getheaders message (MsgGetHeaders). The maximum number of block headers per message is currently 2000. See MsgGetHeaders for details on requesting the headers.

Inheritance

Constructors

MsgHeaders({required List<BlockHeader> headers})
Creates a new MsgHeaders message.
MsgHeaders.deserialize(Uint8List data)
Deserializes a MsgHeaders from byte data.
factory
MsgHeaders.empty()
Creates an empty MsgHeaders message.

Properties

command String
Get the command string for this message type
no setteroverride
count int
Returns the number of headers in this message.
no setter
hashCode int
The hash code for this object.
no setteroverride
headers List<BlockHeader>
List of block headers in this message.
final
isEmpty bool
Checks if this message is empty.
no setter
isNotEmpty bool
Checks if this message is not empty.
no setter
maxPayloadLength int
Get maximum payload length for this message type
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBlockHeader(BlockHeader bh) → void
Adds a new block header to the message.
decode(Uint8List data, int protocolVersion, MessageEncoding encoding) → void
Decode message from bytes
override
encode(int protocolVersion, MessageEncoding encoding) Uint8List
Encode message to bytes
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize(int protocolVersion, BitcoinNetwork network) Uint8List
Serialize complete message with header
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

registerWithFactory() → void
Register this message type with the factory.