aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2020-06-16 18:58:56 +1000
committerAnthony Towns <aj@erisian.com.au>2021-06-29 17:11:12 +1000
commit2b0d291da8f479739ff394dd92801da8c40b9f8e (patch)
tree50968fbedda38d56cfd6fa5b1a7c2a3ee037ddab /src/miner.cpp
parenteccd736f3dc231ac0306ca763c3b72cf8247230a (diff)
downloadbitcoin-2b0d291da8f479739ff394dd92801da8c40b9f8e.tar.xz
[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/miner.cpp')
-rw-r--r--src/miner.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/miner.cpp b/src/miner.cpp
index 0cf303eb3c..c1a992b9e9 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -13,6 +13,7 @@
#include <consensus/merkle.h>
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
+#include <deploymentstatus.h>
#include <policy/feerate.h>
#include <policy/policy.h>
#include <pow.h>
@@ -137,12 +138,12 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
// This is only needed in case the witness softfork activation is reverted
// (which would require a very deep reorganization).
// Note that the mempool would accept transactions with witness data before
- // IsWitnessEnabled, but we would only ever mine blocks after IsWitnessEnabled
+ // the deployment is active, but we would only ever mine blocks after activation
// unless there is a massive block reorganization with the witness softfork
// not activated.
// TODO: replace this with a call to main to assess validity of a mempool
// transaction (which in most cases can be a no-op).
- fIncludeWitness = IsWitnessEnabled(pindexPrev, chainparams.GetConsensus());
+ fIncludeWitness = DeploymentActiveAfter(pindexPrev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT);
int nPackagesSelected = 0;
int nDescendantsUpdated = 0;