Package org.bitcoinj.core
Class GetDataMessage
java.lang.Object
org.bitcoinj.core.Message
org.bitcoinj.core.ListMessage
org.bitcoinj.core.GetDataMessage
Represents the "getdata" P2P network message, which requests the contents of blocks or transactions given their hashes.
Instances of this class are not safe for use by multiple threads.
-
Field Summary
Fields inherited from class org.bitcoinj.core.ListMessage
items, MAX_INVENTORY_ITEMS
Fields inherited from class org.bitcoinj.core.Message
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH
-
Constructor Summary
ConstructorDescriptionGetDataMessage
(NetworkParameters params) GetDataMessage
(NetworkParameters params, byte[] payloadBytes) GetDataMessage
(NetworkParameters params, byte[] payload, MessageSerializer serializer, int length) Deserializes a 'getdata' message. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBlock
(Sha256Hash hash, boolean includeWitness) void
addFilteredBlock
(Sha256Hash hash) void
addTransaction
(Sha256Hash hash, boolean includeWitness) getHashOf
(int i) Methods inherited from class org.bitcoinj.core.ListMessage
addItem, bitcoinSerializeToStream, equals, getItems, hashCode, parse, removeItem, 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
-
Constructor Details
-
GetDataMessage
- Throws:
ProtocolException
-
GetDataMessage
public GetDataMessage(NetworkParameters params, byte[] payload, MessageSerializer serializer, int length) throws ProtocolException Deserializes a 'getdata' message.- Parameters:
params
- NetworkParameters object.payload
- Bitcoin protocol formatted byte array containing message content.serializer
- the serializer to use for this message.length
- The length of message if known. Usually this is provided when deserializing of the wire as the length will be provided as part of the header. If unknown then set to Message.UNKNOWN_LENGTH- Throws:
ProtocolException
-
GetDataMessage
-
-
Method Details
-
addTransaction
-
addBlock
-
addFilteredBlock
-
getHashOf
-