Files
bitcoin/src/deploymentinfo.cpp
Sjors Provoost 5e87c3ec09 scripted-diff: rename gbt_force and gbt_force_name
The term "force" is ambiguous and not used in BIP9 where the ! rule
prefix is introduced.

Additionally, #29039 renamed gbt_vb_name to gbt_force_name which
might increase the confusion.

-BEGIN VERIFY SCRIPT-
sed -i s/gbt_force_name/gbt_rule_value/g ./src/rpc/mining.cpp
sed -i s/gbt_force/gbt_optional_rule/g $(git grep -l gbt_force)
-END VERIFY SCRIPT-
2025-04-30 14:51:21 +02:00

55 lines
1.6 KiB
C++

// Copyright (c) 2016-2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <deploymentinfo.h>
#include <consensus/params.h>
#include <string_view>
const std::array<VBDeploymentInfo,Consensus::MAX_VERSION_BITS_DEPLOYMENTS> VersionBitsDeploymentInfo{
VBDeploymentInfo{
.name = "testdummy",
.gbt_optional_rule = true,
},
VBDeploymentInfo{
.name = "taproot",
.gbt_optional_rule = true,
},
};
std::string DeploymentName(Consensus::BuriedDeployment dep)
{
assert(ValidDeployment(dep));
switch (dep) {
case Consensus::DEPLOYMENT_HEIGHTINCB:
return "bip34";
case Consensus::DEPLOYMENT_CLTV:
return "bip65";
case Consensus::DEPLOYMENT_DERSIG:
return "bip66";
case Consensus::DEPLOYMENT_CSV:
return "csv";
case Consensus::DEPLOYMENT_SEGWIT:
return "segwit";
} // no default case, so the compiler can warn about missing cases
return "";
}
std::optional<Consensus::BuriedDeployment> GetBuriedDeployment(const std::string_view name)
{
if (name == "segwit") {
return Consensus::BuriedDeployment::DEPLOYMENT_SEGWIT;
} else if (name == "bip34") {
return Consensus::BuriedDeployment::DEPLOYMENT_HEIGHTINCB;
} else if (name == "dersig") {
return Consensus::BuriedDeployment::DEPLOYMENT_DERSIG;
} else if (name == "cltv") {
return Consensus::BuriedDeployment::DEPLOYMENT_CLTV;
} else if (name == "csv") {
return Consensus::BuriedDeployment::DEPLOYMENT_CSV;
}
return std::nullopt;
}