diff options
author | James O'Beirne <james.obeirne@gmail.com> | 2019-04-25 11:09:29 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2021-02-12 07:53:22 -0600 |
commit | 7a6c46b37edb8bfa0085d202aa7e9427d5e4fceb (patch) | |
tree | 68f691ce5fec4b11dc22465db1ac82b25662f128 /src/validation.cpp | |
parent | e9c037ba64dd5b073fccf059ef75db1c97abd0bd (diff) |
chainparams: add allowed assumeutxo values
Values for mainnet and testnet will be specified in a follow-up PR that can be
scrutinized accordingly. This structure is required for use in snapshot activation
logic.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 778d75ce18..993b4cdb65 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -22,6 +22,7 @@ #include <logging/timer.h> #include <node/ui_interface.h> #include <optional.h> +#include <node/coinstats.h> #include <policy/policy.h> #include <policy/settings.h> #include <pow.h> @@ -5192,6 +5193,18 @@ CChainState& ChainstateManager::InitializeChainstate(CTxMemPool& mempool, const return *to_modify; } +const AssumeutxoData* ExpectedAssumeutxo( + const int height, const CChainParams& chainparams) +{ + const MapAssumeutxo& valid_assumeutxos_map = chainparams.Assumeutxo(); + const auto assumeutxo_found = valid_assumeutxos_map.find(height); + + if (assumeutxo_found != valid_assumeutxos_map.end()) { + return &assumeutxo_found->second; + } + return nullptr; +} + CChainState& ChainstateManager::ActiveChainstate() const { LOCK(::cs_main); |