Package nxt.peer
Class NetworkMessage.GetNextBlocksMessage
java.lang.Object
nxt.peer.NetworkMessage
nxt.peer.NetworkMessage.GetNextBlocksMessage
- Enclosing class:
- NetworkMessage
The GetNextBlocks message is sent when a peer is downloading the blockchain.
The Blocks message is returned in response.
- Message identifier (long)
- Start block identifier (long)
- Maximum number of blocks (integer)
- Block identifier list (long)
-
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
ConstructorsConstructorDescriptionGetNextBlocksMessage(long blockId, int limit, List<Long> blockIds) Construct a GetNextBlocks message -
Method Summary
Modifier and TypeMethodDescriptionprotected NetworkMessageconstructMessage(ByteBuffer bytes) Construct the message from the message byteslongGet the start block identifierGet the block identifiersintgetLimit()Get the maximum number of blocks
-
Constructor Details
-
GetNextBlocksMessage
Construct a GetNextBlocks message- Parameters:
blockId- Start block identifierlimit- Maximum number of blocksblockIds- Block identifier list 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 start block identifier- Returns:
- Start block identifier
-
getLimit
public int getLimit()Get the maximum number of blocks- Returns:
- Maximum number of blocks
-
getBlockIds
Get the block identifiers- Returns:
- Block identifiers
-