nxt.peer

## Class NetworkMessage.CumulativeDifficultyMessage

- java.lang.Object
- - nxt.peer.NetworkMessage
  - - nxt.peer.NetworkMessage.CumulativeDifficultyMessage

- Enclosing class:
    NetworkMessage

      public static class NetworkMessage.CumulativeDifficultyMessage
      extends NetworkMessage

  The CumulativeDifficulty message is returned in response to the GetCumulativeDifficulty message. The message identifier is obtained from the GetCumulativeDifficulty message.
  - Message identifier (long)
  - Cumulative difficulty (big integer)
  - Block height (integer)

- - ### 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, messageId`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CumulativeDifficultyMessage(long messageId, java.math.BigInteger cumulativeDifficulty, int blockHeight)` Construct a CumulativeDifficulty message

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected NetworkMessage` | `constructMessage(java.nio.ByteBuffer bytes)` Construct the message from the message bytes
    `int` | `getBlockHeight()` Get the block height
    `java.math.BigInteger` | `getCumulativeDifficulty()` Get the cumulative difficulty

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CumulativeDifficultyMessage

          public CumulativeDifficultyMessage(long messageId,
                                             java.math.BigInteger cumulativeDifficulty,
                                             int blockHeight)

      Construct a CumulativeDifficulty message
      Parameters:
        `messageId` - Message identifier from the GetCumulativeDifficulty message
        `cumulativeDifficulty` - Cumulative difficulty
        `blockHeight` - Block height

  - ### Method Detail

    - #### constructMessage

          protected NetworkMessage constructMessage(java.nio.ByteBuffer bytes)
                                             throws java.nio.BufferOverflowException,
                                                    java.nio.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:
        `java.nio.BufferOverflowException` - Message buffer is too small
        `java.nio.BufferUnderflowException` - Message is too short
        `NetworkException` - Message is not valid

    - #### getCumulativeDifficulty

          public java.math.BigInteger getCumulativeDifficulty()

      Get the cumulative difficulty
      Returns:
        Cumulative difficulty

    - #### getBlockHeight

          public int getBlockHeight()

      Get the block height
      Returns:
        Block height