Bitcoin Core  27.99.0
P2P Digital Currency
deploymentinfo.cpp
Go to the documentation of this file.
1 // Copyright (c) 2016-2021 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 
12  {
13  /*.name =*/ "testdummy",
14  /*.gbt_force =*/ true,
15  },
16  {
17  /*.name =*/ "taproot",
18  /*.gbt_force =*/ 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 }
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS]
std::string DeploymentName(Consensus::BuriedDeployment dep)
std::optional< Consensus::BuriedDeployment > GetBuriedDeployment(const std::string_view name)
Transaction validation functions.
constexpr bool ValidDeployment(BuriedDeployment dep)
Definition: params.h:30
@ MAX_VERSION_BITS_DEPLOYMENTS
Definition: params.h:36
BuriedDeployment
A buried deployment is one where the height of the activation has been hardcoded into the client impl...
Definition: params.h:22
@ DEPLOYMENT_DERSIG
Definition: params.h:26
@ DEPLOYMENT_CSV
Definition: params.h:27
@ DEPLOYMENT_SEGWIT
Definition: params.h:28
@ DEPLOYMENT_HEIGHTINCB
Definition: params.h:24
@ DEPLOYMENT_CLTV
Definition: params.h:25
const char * name
Definition: rest.cpp:50
assert(!tx.IsCoinBase())