com.google.bitcoin.core
Class GetHeadersMessage
java.lang.Object
com.google.bitcoin.core.Message
com.google.bitcoin.core.GetBlocksMessage
com.google.bitcoin.core.GetHeadersMessage
- All Implemented Interfaces:
- Serializable
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.
- See Also:
- Serialized Form
| Fields inherited from class com.google.bitcoin.core.Message |
bytes, checksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, protocolVersion, recached, UNKNOWN_LENGTH |
| Methods inherited from class com.google.bitcoin.core.Message |
adjustLength, bitcoinSerialize, bitcoinSerialize, ensureParsed, getHash, getMessageSize, getParams, isCached, isParsed, isRecached, maybeParse, unCache, unsafeBitcoinSerialize |
GetHeadersMessage
public GetHeadersMessage(NetworkParameters params,
List<Sha256Hash> locator,
Sha256Hash stopHash)
GetHeadersMessage
public GetHeadersMessage(NetworkParameters params,
byte[] msg)
throws ProtocolException
- Throws:
ProtocolException
toString
public String toString()
- Overrides:
toString in class GetBlocksMessage
equals
public boolean equals(Object o)
- Compares two getheaders messages. Note that even though they are structurally identical a GetHeadersMessage
will not compare equal to a GetBlocksMessage containing the same data.
- Overrides:
equals in class GetBlocksMessage
hashCode
public int hashCode()
- Overrides:
hashCode in class GetBlocksMessage
Copyright © 2014. All rights reserved.