diff options
author | Anthony Towns <aj@erisian.com.au> | 2020-06-16 18:58:56 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2021-06-29 17:11:12 +1000 |
commit | 2b0d291da8f479739ff394dd92801da8c40b9f8e (patch) | |
tree | 50968fbedda38d56cfd6fa5b1a7c2a3ee037ddab /src/init.cpp | |
parent | eccd736f3dc231ac0306ca763c3b72cf8247230a (diff) |
[refactor] Add deploymentstatus.h
Provides DeploymentEnabled, DeploymentActiveAt, and DeploymentActiveAfter
helpers for checking the status of buried deployments. Can be overloaded
so the same syntax works for non-buried deployments, allowing future
soft forks to be changed from signalled to buried deployments without
having to touch the implementation code.
Replaces IsWitnessEnabled and IsScriptWitnessEnabled.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index a88adbaa21..ae96f510bc 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -16,6 +16,7 @@ #include <chain.h> #include <chainparams.h> #include <compat/sanity.h> +#include <deploymentstatus.h> #include <fs.h> #include <hash.h> #include <httprpc.h> @@ -1587,7 +1588,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) } } - if (chainparams.GetConsensus().SegwitHeight != std::numeric_limits<int>::max()) { + if (DeploymentEnabled(chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) { // Advertise witness capabilities. // The option to not set NODE_WITNESS is only used in the tests and should be removed. nLocalServices = ServiceFlags(nLocalServices | NODE_WITNESS); |