Package org.bitcoinj.core
Class GetDataMessage
- java.lang.Object
-
- org.bitcoinj.core.Message
-
- org.bitcoinj.core.ListMessage
-
- org.bitcoinj.core.GetDataMessage
-
public class GetDataMessage extends ListMessage
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
MAX_SIZE, params, payload, serializer
-
-
Constructor Summary
Constructors Constructor Description GetDataMessage(NetworkParameters params)
GetDataMessage(NetworkParameters params, java.nio.ByteBuffer payload)
GetDataMessage(NetworkParameters params, java.nio.ByteBuffer payload, MessageSerializer serializer)
Deserializes a 'getdata' message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBlock(Sha256Hash hash, boolean includeWitness)
void
addFilteredBlock(Sha256Hash hash)
void
addTransaction(Sha256Hash hash, boolean includeWitness)
Sha256Hash
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
bitcoinSerialize, getHash, getMessageSize, getParams, readByte, readByteArray, readBytes, readHash, readInt32, readInt64, readStr, readUint32, readUint64, readVarInt, skipBytes, unCache, unsafeBitcoinSerialize
-
-
-
-
Constructor Detail
-
GetDataMessage
public GetDataMessage(NetworkParameters params, java.nio.ByteBuffer payload) throws ProtocolException
- Throws:
ProtocolException
-
GetDataMessage
public GetDataMessage(NetworkParameters params, java.nio.ByteBuffer payload, MessageSerializer serializer) 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.- Throws:
ProtocolException
-
GetDataMessage
public GetDataMessage(NetworkParameters params)
-
-
Method Detail
-
addTransaction
public void addTransaction(Sha256Hash hash, boolean includeWitness)
-
addBlock
public void addBlock(Sha256Hash hash, boolean includeWitness)
-
addFilteredBlock
public void addFilteredBlock(Sha256Hash hash)
-
getHashOf
public Sha256Hash getHashOf(int i)
-
-