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, version
cursor, length, MAX_SIZE, offset, params, payload, protocolVersion, recached, serializer, UNKNOWN_LENGTH
Constructor and Description |
---|
GetHeadersMessage(NetworkParameters params,
byte[] payload) |
GetHeadersMessage(NetworkParameters params,
List<Sha256Hash> locator,
Sha256Hash stopHash) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compares two getheaders messages.
|
int |
hashCode() |
String |
toString() |
bitcoinSerializeToStream, getLocator, getStopHash, parse
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, unCache, unsafeBitcoinSerialize
public GetHeadersMessage(NetworkParameters params, List<Sha256Hash> locator, Sha256Hash stopHash)
public GetHeadersMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolException
public String toString()
toString
in class GetBlocksMessage
public boolean equals(Object o)
equals
in class GetBlocksMessage
public int hashCode()
hashCode
in class GetBlocksMessage
Copyright © 2016. All rights reserved.