PIVX Core  5.6.99
P2P Digital Currency
Public Attributes | Static Public Attributes | List of all members
Consensus::NetworkUpgrade Struct Reference

#include <params.h>

Public Attributes

int nProtocolVersion
 The first protocol version which will understand the new consensus rules. More...
 
int nActivationHeight
 Height of the first block for which the new consensus rules will be active. More...
 
Optional< uint256hashActivationBlock
 The hash of the block at height nActivationHeight, if known. More...
 

Static Public Attributes

static constexpr int ALWAYS_ACTIVE = 0
 Special value for nActivationHeight indicating that the upgrade is always active. More...
 
static constexpr int NO_ACTIVATION_HEIGHT = -1
 Special value for nActivationHeight indicating that the upgrade will never activate. More...
 

Detailed Description

Definition at line 47 of file params.h.

Member Data Documentation

◆ ALWAYS_ACTIVE

constexpr int Consensus::NetworkUpgrade::ALWAYS_ACTIVE = 0
staticconstexpr

Special value for nActivationHeight indicating that the upgrade is always active.

This is useful for testing, as it means tests don't need to deal with the activation process (namely, faking a chain of somewhat-arbitrary length).

New blockchains that want to enable upgrade rules from the beginning can also use this value. However, additional care must be taken to ensure the genesis block satisfies the enabled rules.

Definition at line 67 of file params.h.

◆ hashActivationBlock

Optional<uint256> Consensus::NetworkUpgrade::hashActivationBlock

The hash of the block at height nActivationHeight, if known.

This is set manually after a network upgrade activates.

We use this in IsInitialBlockDownload to detect whether we are potentially being fed a fake alternate chain. We use NU activation blocks for this purpose instead of the checkpoint blocks, because network upgrades (should) have significantly more scrutiny than regular releases. nMinimumChainWork MUST be set to at least the chain work of this block, otherwise this detection will have false positives.

Definition at line 86 of file params.h.

◆ nActivationHeight

int Consensus::NetworkUpgrade::nActivationHeight

Height of the first block for which the new consensus rules will be active.

Definition at line 56 of file params.h.

◆ NO_ACTIVATION_HEIGHT

constexpr int Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT = -1
staticconstexpr

Special value for nActivationHeight indicating that the upgrade will never activate.

This is useful when adding upgrade code that has a testnet activation height, but should remain disabled on mainnet.

Definition at line 74 of file params.h.

◆ nProtocolVersion

int Consensus::NetworkUpgrade::nProtocolVersion

The first protocol version which will understand the new consensus rules.

Definition at line 51 of file params.h.


The documentation for this struct was generated from the following file: