diff options
author | MacroFake <falke.marco@gmail.com> | 2022-08-05 14:45:30 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-08-05 14:45:02 +0200 |
commit | fa3be799fe951a7ea9b4de78d5a907c6db71eeb8 (patch) | |
tree | 31c48c6ccf090d3961f6acfbd04d29b3ff7034ae /src/consensus | |
parent | 7d82f86341072311a0e62807213e17925efde299 (diff) |
Add time helpers
To be used in the next commit
Diffstat (limited to 'src/consensus')
-rw-r--r-- | src/consensus/params.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/consensus/params.h b/src/consensus/params.h index 794e0f5383..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> @@ -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; |