Package nxt.peer
Class NetworkMessage.CumulativeDifficultyMessage
java.lang.Object
nxt.peer.NetworkMessage
nxt.peer.NetworkMessage.CumulativeDifficultyMessage
- Enclosing class:
- 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, MAX_LIST_SIZE_PRE_2_3_3, messageId -
Constructor Summary
ConstructorsConstructorDescriptionCumulativeDifficultyMessage(long messageId, BigInteger cumulativeDifficulty, int blockHeight) Construct a CumulativeDifficulty message -
Method Summary
Modifier and TypeMethodDescriptionprotected NetworkMessageconstructMessage(ByteBuffer bytes) Construct the message from the message bytesintGet the block heightGet the cumulative difficulty
-
Constructor Details
-
CumulativeDifficultyMessage
public CumulativeDifficultyMessage(long messageId, BigInteger cumulativeDifficulty, int blockHeight) Construct a CumulativeDifficulty message- Parameters:
messageId- Message identifier from the GetCumulativeDifficulty messagecumulativeDifficulty- Cumulative difficultyblockHeight- Block height
-
-
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
-
getCumulativeDifficulty
Get the cumulative difficulty- Returns:
- Cumulative difficulty
-
getBlockHeight
public int getBlockHeight()Get the block height- Returns:
- Block height
-