Package nxt.peer
Class NetworkMessage.GetBlockMessage
java.lang.Object
nxt.peer.NetworkMessage
nxt.peer.NetworkMessage.GetBlockMessage
- Enclosing class:
- NetworkMessage
The GetBlock message is sent when a peer is notified that a new block is available.
The Blocks message is returned in response. The sender can include a list of transactions
to be excluded when creating the Blocks message. The sender must then supply
the excluded transactions when it receives the Blocks message.
- Message identifier (long)
- Block identifier (long)
- Transaction exclusion BitSet (byte[])
-
Nested Class Summary
Nested classes/interfaces inherited from class nxt.peer.NetworkMessage
NetworkMessage.AddPeersMessage, NetworkMessage.BlockchainStateMessage, NetworkMessage.BlockIdsMessage, NetworkMessage.BlockInventoryMessage, NetworkMessage.BlocksMessage, NetworkMessage.BundlerRateMessage, NetworkMessage.CumulativeDifficultyMessage, NetworkMessage.ErrorMessage, NetworkMessage.GetBlockMessage, NetworkMessage.GetCumulativeDifficultyMessage, NetworkMessage.GetInfoMessage, NetworkMessage.GetMilestoneBlockIdsMessage, NetworkMessage.GetNextBlockIdsMessage, NetworkMessage.GetNextBlocksMessage, NetworkMessage.GetPeersMessage, NetworkMessage.GetTransactionsMessage, NetworkMessage.GetUnconfirmedTransactionsMessage, NetworkMessage.MilestoneBlockIdsMessage, NetworkMessage.TransactionsInventoryMessage, NetworkMessage.TransactionsMessage -
Field Summary
Fields inherited from class nxt.peer.NetworkMessage
MAX_ARRAY_LENGTH, MAX_LIST_SIZE, MAX_LIST_SIZE_PRE_2_3_3, messageId -
Constructor Summary
ConstructorsConstructorDescriptionGetBlockMessage(long blockId) Construct a GetBlocks messageGetBlockMessage(long blockId, BitSet excludedTransactions) Construct a GetBlock message Transactions can be excluded -
Method Summary
Modifier and TypeMethodDescriptionprotected NetworkMessageconstructMessage(ByteBuffer bytes) Construct the message from the message byteslongGet the block identifierbyte[]Get the excluded transaction identifiers
-
Constructor Details
-
GetBlockMessage
public GetBlockMessage(long blockId) Construct a GetBlocks message- Parameters:
blockId- Block identifier
-
GetBlockMessage
Construct a GetBlock message Transactions can be excluded- Parameters:
blockId- Block identifierexcludedTransactions- Excluded transactions or null
-
-
Method Details
-
constructMessage
protected NetworkMessage constructMessage(ByteBuffer bytes) throws BufferOverflowException, BufferUnderflowException, nxt.peer.NetworkException Construct the message from the message bytes- Overrides:
constructMessagein classNetworkMessage- Parameters:
bytes- Message bytes following the message name- Returns:
- Message
- Throws:
BufferOverflowException- Message buffer is too smallBufferUnderflowException- Message is too shortnxt.peer.NetworkException- Message is not valid
-
getBlockId
public long getBlockId()Get the block identifier- Returns:
- Block identifier
-
getExcludedTransactions
public byte[] getExcludedTransactions()Get the excluded transaction identifiers- Returns:
- Transaction identifiers
-