deploymentinfo: Add DeploymentName()

This commit is contained in:
Anthony Towns
2021-03-11 12:47:24 +10:00
parent ea68b3a572
commit 92f48f360d
2 changed files with 31 additions and 1 deletions

View File

@@ -16,3 +16,21 @@ const struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_B
/*.gbt_force =*/ 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 "";
}