PIVX Core  5.6.99
P2P Digital Currency
Classes | Enumerations | Functions | Variables
upgrades.h File Reference
#include "consensus/params.h"
#include "optional.h"
Include dependency graph for upgrades.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NUInfo
 

Enumerations

enum  UpgradeState { UPGRADE_DISABLED , UPGRADE_PENDING , UPGRADE_ACTIVE }
 

Functions

UpgradeState NetworkUpgradeState (int nHeight, const Consensus::Params &params, Consensus::UpgradeIndex idx)
 Checks the state of a given network upgrade based on block height. More...
 
bool NetworkUpgradeActive (int nHeight, const Consensus::Params &params, Consensus::UpgradeIndex idx)
 Returns true if the given network upgrade is active as of the given block height. More...
 
int CurrentEpoch (int nHeight, const Consensus::Params &params)
 Returns the index of the most recent upgrade as of the given block height (corresponding to the current "epoch"). More...
 
bool IsActivationHeight (int nHeight, const Consensus::Params &params, Consensus::UpgradeIndex upgrade)
 Returns true if the given block height is the activation height for the given upgrade. More...
 
bool IsActivationHeightForAnyUpgrade (int nHeight, const Consensus::Params &params)
 Returns true if the given block height is the activation height for any upgrade. More...
 
Optional< int > NextEpoch (int nHeight, const Consensus::Params &params)
 Returns the index of the next upgrade after the given block height, or nullopt if there are no more known upgrades. More...
 
Optional< int > NextActivationHeight (int nHeight, const Consensus::Params &params)
 Returns the activation height for the next upgrade after the given block height, or nullopt if there are no more known upgrades. More...
 

Variables

const struct NUInfo NetworkUpgradeInfo []
 General information about each network upgrade. More...
 

Enumeration Type Documentation

◆ UpgradeState

Enumerator
UPGRADE_DISABLED 
UPGRADE_PENDING 
UPGRADE_ACTIVE 

Definition at line 12 of file upgrades.h.

Function Documentation

◆ CurrentEpoch()

int CurrentEpoch ( int  nHeight,
const Consensus::Params params 
)

Returns the index of the most recent upgrade as of the given block height (corresponding to the current "epoch").

Consensus::BASE_NETWORK is the default value if no upgrades are active. Caller must check that the height is >= 0 (and handle unknown heights).

Definition at line 115 of file upgrades.cpp.

Here is the call graph for this function:

◆ IsActivationHeight()

bool IsActivationHeight ( int  nHeight,
const Consensus::Params params,
Consensus::UpgradeIndex  upgrade 
)

Returns true if the given block height is the activation height for the given upgrade.

Definition at line 124 of file upgrades.cpp.

Here is the caller graph for this function:

◆ IsActivationHeightForAnyUpgrade()

bool IsActivationHeightForAnyUpgrade ( int  nHeight,
const Consensus::Params params 
)

Returns true if the given block height is the activation height for any upgrade.

Definition at line 139 of file upgrades.cpp.

Here is the caller graph for this function:

◆ NetworkUpgradeActive()

bool NetworkUpgradeActive ( int  nHeight,
const Consensus::Params params,
Consensus::UpgradeIndex  idx 
)

Returns true if the given network upgrade is active as of the given block height.

Caller must check that the height is >= 0 (and handle unknown heights).

Definition at line 107 of file upgrades.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NetworkUpgradeState()

UpgradeState NetworkUpgradeState ( int  nHeight,
const Consensus::Params params,
Consensus::UpgradeIndex  idx 
)

Checks the state of a given network upgrade based on block height.

Caller must check that the height is >= 0 (and handle unknown heights).

Definition at line 82 of file upgrades.cpp.

Here is the caller graph for this function:

◆ NextActivationHeight()

Optional<int> NextActivationHeight ( int  nHeight,
const Consensus::Params params 
)

Returns the activation height for the next upgrade after the given block height, or nullopt if there are no more known upgrades.

Definition at line 170 of file upgrades.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NextEpoch()

Optional<int> NextEpoch ( int  nHeight,
const Consensus::Params params 
)

Returns the index of the next upgrade after the given block height, or nullopt if there are no more known upgrades.

Definition at line 155 of file upgrades.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ NetworkUpgradeInfo

const struct NUInfo NetworkUpgradeInfo[]
extern

General information about each network upgrade.

Ordered by Consensus::UpgradeIndex.

If the upgrade name has many words, use the '_' character to divide them. We are using it in the -nuparams startup arg and input it with spaces is just ugly.

Definition at line 1 of file upgrades.cpp.