Bitcoin Core  29.1.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 }
assert(!tx.IsCoinBase())
Transaction validation functions.
const char * name
Definition: rest.cpp:49
const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS]
BuriedDeployment
A buried deployment is one where the height of the activation has been hardcoded into the client impl...
Definition: params.h:22
constexpr bool ValidDeployment(BuriedDeployment dep)
Definition: params.h:30
std::optional< Consensus::BuriedDeployment > GetBuriedDeployment(const std::string_view name)
std::string DeploymentName(Consensus::BuriedDeployment dep)