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,
java.util.List<Block> headers) |
| Modifier and Type | Method and Description |
|---|---|
void |
bitcoinSerializeToStream(java.io.OutputStream stream)
Serializes this message to the provided stream.
|
java.util.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, unsafeBitcoinSerializepublic static final int MAX_HEADERS
public HeadersMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolExceptionpublic HeadersMessage(NetworkParameters params, Block... headers) throws ProtocolException
ProtocolExceptionpublic HeadersMessage(NetworkParameters params, java.util.List<Block> headers) throws ProtocolException
ProtocolExceptionpublic void bitcoinSerializeToStream(java.io.OutputStream stream)
throws java.io.IOException
MessagebitcoinSerializeToStream in class Messagejava.io.IOExceptionprotected void parse()
throws ProtocolException
parse in class MessageProtocolExceptionpublic java.util.List<Block> getBlockHeaders()