From 4cab84cfdfc98cd10462681b5eb0fbbc08afd2a7 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Sat, 6 Mar 2021 18:18:49 +1000 Subject: versionbits: Add support for delayed activation Github-Pull: #21377 Rebased-From: 73d4a706393e6dbd6b6d6b6428f8d3233ac0a2d8 --- src/consensus/params.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/consensus') diff --git a/src/consensus/params.h b/src/consensus/params.h index 0983595c6a..5d566a01b9 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -29,6 +29,11 @@ struct BIP9Deployment { int64_t nStartTime; /** Timeout/expiry MedianTime for the deployment attempt. */ int64_t nTimeout; + /** If lock in occurs, delay activation until at least this block + * height. Note that activation will only occur on a retarget + * boundary. + */ + int min_activation_height{0}; /** Constant for nTimeout very far in the future. */ static constexpr int64_t NO_TIMEOUT = std::numeric_limits::max(); -- cgit v1.2.3 From 3acf0379e0979ea4bdd03976f4987aa6711eb92f Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Sat, 27 Mar 2021 23:00:14 +1000 Subject: versionbits: Add explicit NEVER_ACTIVE deployments Previously we used deployments that would timeout prior to Bitcoin's invention, which allowed the deployment to still be activated in unit tests. This switches those deployments to be truly never active. Github-Pull: #21377 Rebased-From: 55ac5f568a3b73d6f1ef4654617fb76e8bcbccdf --- src/consensus/params.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/consensus') diff --git a/src/consensus/params.h b/src/consensus/params.h index 5d566a01b9..1b1c7f24b6 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -43,6 +43,11 @@ struct BIP9Deployment { * process (which takes at least 3 BIP9 intervals). Only tests that specifically test the * behaviour during activation cannot use this. */ static constexpr int64_t ALWAYS_ACTIVE = -1; + + /** Special value for nStartTime indicating that the deployment is never active. + * This is useful for integrating the code changes for a new feature + * prior to deploying it on some or all networks. */ + static constexpr int64_t NEVER_ACTIVE = -2; }; /** -- cgit v1.2.3