Bitcoin Core  31.0.0
P2P Digital Currency
deploymentinfo.cpp
Go to the documentation of this file.
1 // Copyright (c) 2016-present The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <deploymentinfo.h>
6 
7 #include <consensus/params.h>
8 
9 #include <string_view>
10 
11 const std::array<VBDeploymentInfo,Consensus::MAX_VERSION_BITS_DEPLOYMENTS> VersionBitsDeploymentInfo{
13  .name = "testdummy",
14  .gbt_optional_rule = true,
15  },
17  .name = "taproot",
18  .gbt_optional_rule = true,
19  },
20 };
21 
23 {
24  assert(ValidDeployment(dep));
25  switch (dep) {
27  return "bip34";
29  return "bip65";
31  return "bip66";
33  return "csv";
35  return "segwit";
36  } // no default case, so the compiler can warn about missing cases
37  return "";
38 }
39 
40 std::optional<Consensus::BuriedDeployment> GetBuriedDeployment(const std::string_view name)
41 {
42  if (name == "segwit") {
44  } else if (name == "bip34") {
46  } else if (name == "dersig") {
48  } else if (name == "cltv") {
50  } else if (name == "csv") {
52  }
53  return std::nullopt;
54 }
assert(!tx.IsCoinBase())
const char * name
Definition: rest.cpp:48
const std::array< VBDeploymentInfo, Consensus::MAX_VERSION_BITS_DEPLOYMENTS > VersionBitsDeploymentInfo
const char * name
Deployment name.
BuriedDeployment
A buried deployment is one where the height of the activation has been hardcoded into the client impl...
Definition: params.h:24
constexpr bool ValidDeployment(BuriedDeployment dep)
Definition: params.h:32
std::optional< Consensus::BuriedDeployment > GetBuriedDeployment(const std::string_view name)
std::string DeploymentName(Consensus::BuriedDeployment dep)