public class GetHeadersMessage extends GetBlocksMessage
The "getheaders" command is structurally identical to "getblocks", but has different meaning. On receiving this message a Bitcoin node returns matching blocks up to the limit, but without the bodies. It is useful as an optimization: when your wallet does not contain any keys created before a particular time, you don't have to download the bodies for those blocks because you know there are no relevant transactions.
Instances of this class are not safe for use by multiple threads.
locator, stopHash, versioncursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH| Constructor and Description |
|---|
GetHeadersMessage(NetworkParameters params,
BlockLocator locator,
Sha256Hash stopHash) |
GetHeadersMessage(NetworkParameters params,
byte[] payload) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Compares two getheaders messages.
|
int |
hashCode() |
java.lang.String |
toString() |
bitcoinSerializeToStream, getLocator, getStopHash, parseadjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unCache, unsafeBitcoinSerializepublic GetHeadersMessage(NetworkParameters params, BlockLocator locator, Sha256Hash stopHash)
public GetHeadersMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolExceptionpublic java.lang.String toString()
toString in class GetBlocksMessagepublic boolean equals(java.lang.Object o)
equals in class GetBlocksMessagepublic int hashCode()
hashCode in class GetBlocksMessage