diff options
Diffstat (limited to 'src/consensus/params.h')
-rw-r--r-- | src/consensus/params.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/consensus/params.h b/src/consensus/params.h index 0881f2e388..7c35222713 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -8,6 +8,7 @@ #include <uint256.h> +#include <chrono> #include <limits> #include <map> @@ -40,11 +41,11 @@ constexpr bool ValidDeployment(DeploymentPos dep) { return dep < MAX_VERSION_BIT */ struct BIP9Deployment { /** Bit position to select the particular bit in nVersion. */ - int bit; + int bit{28}; /** Start MedianTime for version bits miner confirmation. Can be a date in the past */ - int64_t nStartTime; + int64_t nStartTime{NEVER_ACTIVE}; /** Timeout/expiry MedianTime for the deployment attempt. */ - int64_t nTimeout; + int64_t nTimeout{NEVER_ACTIVE}; /** If lock in occurs, delay activation until at least this block * height. Note that activation will only occur on a retarget * boundary. @@ -109,6 +110,10 @@ struct Params { bool fPowNoRetargeting; int64_t nPowTargetSpacing; int64_t nPowTargetTimespan; + std::chrono::seconds PowTargetSpacing() const + { + return std::chrono::seconds{nPowTargetSpacing}; + } int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; } /** The best chain should have at least this much work */ uint256 nMinimumChainWork; |