Package nxt.peer

Class NetworkMessage.GetNextBlocksMessage

java.lang.Object
nxt.peer.NetworkMessage
nxt.peer.NetworkMessage.GetNextBlocksMessage
Enclosing class:
NetworkMessage

public static class NetworkMessage.GetNextBlocksMessage extends 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)
  • Constructor Details

    • GetNextBlocksMessage

      public GetNextBlocksMessage(long blockId, int limit, List<Long> blockIds)
      Construct a GetNextBlocks message
      Parameters:
      blockId - Start block identifier
      limit - Maximum number of blocks
      blockIds - 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:
      constructMessage in class NetworkMessage
      Parameters:
      bytes - Message bytes following the message name
      Returns:
      Message
      Throws:
      BufferOverflowException - Message buffer is too small
      BufferUnderflowException - Message is too short
      nxt.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

      public List<Long> getBlockIds()
      Get the block identifiers
      Returns:
      Block identifiers