public class HeadersMessage extends Message
A protocol message that contains a repeated series of block headers, sent in response to the "getheaders" command. This is useful when you want to traverse the chain but know you don't care about the block contents, for example, because you have a freshly created wallet with no keys.
Instances of this class are not safe for use by multiple threads.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_HEADERS |
cursor, length, MAX_SIZE, offset, params, payload, protocolVersion, recached, serializer, UNKNOWN_LENGTH
Constructor and Description |
---|
HeadersMessage(NetworkParameters params,
Block... headers) |
HeadersMessage(NetworkParameters params,
byte[] payload) |
HeadersMessage(NetworkParameters params,
List<Block> headers) |
Modifier and Type | Method and Description |
---|---|
void |
bitcoinSerializeToStream(OutputStream stream)
Serializes this message to the provided stream.
|
List<Block> |
getBlockHeaders() |
protected void |
parse() |
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, unCache, unsafeBitcoinSerialize
public static final int MAX_HEADERS
public HeadersMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolException
public HeadersMessage(NetworkParameters params, Block... headers) throws ProtocolException
ProtocolException
public HeadersMessage(NetworkParameters params, List<Block> headers) throws ProtocolException
ProtocolException
public void bitcoinSerializeToStream(OutputStream stream) throws IOException
Message
bitcoinSerializeToStream
in class Message
IOException
protected void parse() throws ProtocolException
parse
in class Message
ProtocolException
Copyright © 2016. All rights reserved.