Package org.bitcoinj.core
Class GetBlocksMessage
java.lang.Object
org.bitcoinj.core.Message
org.bitcoinj.core.GetBlocksMessage
- Direct Known Subclasses:
GetHeadersMessage
Represents the "getblocks" P2P network message, which requests the hashes of the parts of the block chain we're
missing. Those blocks can then be downloaded with a GetDataMessage.
Instances of this class are not safe for use by multiple threads.
-
Field Summary
FieldsFields inherited from class org.bitcoinj.core.Message
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionGetBlocksMessage(NetworkParameters params, byte[] payload) GetBlocksMessage(NetworkParameters params, BlockLocator locator, Sha256Hash stopHash) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbitcoinSerializeToStream(OutputStream stream) Serializes this message to the provided stream.booleaninthashCode()protected voidparse()toString()Methods inherited from class org.bitcoinj.core.Message
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unCache, unsafeBitcoinSerialize
-
Field Details
-
version
protected long version -
locator
-
stopHash
-
-
Constructor Details
-
GetBlocksMessage
-
GetBlocksMessage
- Throws:
ProtocolException
-
-
Method Details
-
parse
- Specified by:
parsein classMessage- Throws:
ProtocolException
-
getLocator
-
getStopHash
-
toString
-
bitcoinSerializeToStream
Description copied from class:MessageSerializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().- Overrides:
bitcoinSerializeToStreamin classMessage- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-