deploymentstatus: allow chainman in place of consensusParams

This commit is contained in:
Anthony Towns 2022-04-15 05:49:31 +10:00
parent eaa2e3f25c
commit deffe0df6c
2 changed files with 20 additions and 1 deletions

View file

@ -16,7 +16,6 @@
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
#include <cuckoocache.h>
#include <deploymentstatus.h>
#include <flatfile.h>
#include <hash.h>
#include <logging.h>

View file

@ -15,6 +15,7 @@
#include <chain.h>
#include <chainparams.h>
#include <consensus/amount.h>
#include <deploymentstatus.h>
#include <fs.h>
#include <node/blockstorage.h>
#include <policy/feerate.h>
@ -1003,6 +1004,25 @@ public:
~ChainstateManager();
};
/** Deployment* info via ChainstateManager */
template<typename DEP>
bool DeploymentActiveAfter(const CBlockIndex* pindexPrev, const ChainstateManager& chainman, DEP dep)
{
return DeploymentActiveAfter(pindexPrev, chainman.GetConsensus(), dep);
}
template<typename DEP>
bool DeploymentActiveAt(const CBlockIndex& index, const ChainstateManager& chainman, DEP dep)
{
return DeploymentActiveAt(index, chainman.GetConsensus(), dep);
}
template<typename DEP>
bool DeploymentEnabled(const ChainstateManager& chainman, DEP dep)
{
return DeploymentEnabled(chainman.GetConsensus(), dep);
}
using FopenFn = std::function<FILE*(const fs::path&, const char*)>;
/** Dump the mempool to disk. */