Bitcoin ABC  0.29.2
P2P Digital Currency
deploymentstatus.h
Go to the documentation of this file.
1 // Copyright (c) 2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_DEPLOYMENTSTATUS_H
6 #define BITCOIN_DEPLOYMENTSTATUS_H
7 
8 #include <chain.h>
9 
10 #include <limits>
11 
13 inline bool DeploymentActiveAfter(const CBlockIndex *pindexPrev,
14  const Consensus::Params &params,
17  return (pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1) >=
18  params.DeploymentHeight(dep);
19 }
20 
22 inline bool DeploymentActiveAt(const CBlockIndex &index,
23  const Consensus::Params &params,
26  return index.nHeight >= params.DeploymentHeight(dep);
27 }
28 
29 #endif // BITCOIN_DEPLOYMENTSTATUS_H
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: blockindex.h:26
int nHeight
height of the entry in the chain. The genesis block has height 0
Definition: blockindex.h:39
bool DeploymentActiveAfter(const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::BuriedDeployment dep)
Determine if a deployment is active for the next block.
bool DeploymentActiveAt(const CBlockIndex &index, const Consensus::Params &params, Consensus::BuriedDeployment dep)
Determine if a deployment is active for this block.
constexpr bool ValidDeployment(BuriedDeployment dep)
Definition: params.h:27
BuriedDeployment
Definition: params.h:17
Parameters that influence chain consensus.
Definition: params.h:34
int DeploymentHeight(BuriedDeployment dep) const
Definition: params.h:91
assert(!tx.IsCoinBase())