diff --git a/src/deploymentinfo.cpp b/src/deploymentinfo.cpp index 0931ec77d37..5c4795505be 100644 --- a/src/deploymentinfo.cpp +++ b/src/deploymentinfo.cpp @@ -11,11 +11,11 @@ const std::array VersionBitsDeploymentInfo{ VBDeploymentInfo{ .name = "testdummy", - .gbt_force = true, + .gbt_optional_rule = true, }, VBDeploymentInfo{ .name = "taproot", - .gbt_force = true, + .gbt_optional_rule = true, }, }; diff --git a/src/deploymentinfo.h b/src/deploymentinfo.h index b6ca4450f41..10029b0e30a 100644 --- a/src/deploymentinfo.h +++ b/src/deploymentinfo.h @@ -15,7 +15,7 @@ struct VBDeploymentInfo { /** Deployment name */ const char *name; /** Whether GBT clients can safely ignore this rule in simplified usage */ - bool gbt_force; + bool gbt_optional_rule; }; extern const std::array VersionBitsDeploymentInfo; diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 7c2dd409233..82b099d1aac 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -596,10 +596,10 @@ static UniValue BIP22ValidationResult(const BlockValidationState& state) return "valid?"; } -static std::string gbt_force_name(const std::string& name, bool gbt_force) +static std::string gbt_rule_value(const std::string& name, bool gbt_optional_rule) { std::string s{name}; - if (!gbt_force) { + if (!gbt_optional_rule) { s.insert(s.begin(), '!'); } return s; @@ -955,8 +955,8 @@ static RPCHelpMan getblocktemplate() const auto gbtstatus = chainman.m_versionbitscache.GBTStatus(*pindexPrev, consensusParams); for (const auto& [name, info] : gbtstatus.signalling) { - vbavailable.pushKV(gbt_force_name(name, info.gbt_force), info.bit); - if (!info.gbt_force && !setClientRules.count(name)) { + vbavailable.pushKV(gbt_rule_value(name, info.gbt_optional_rule), info.bit); + if (!info.gbt_optional_rule && !setClientRules.count(name)) { // If the client doesn't support this, don't indicate it in the [default] version block.nVersion &= ~info.mask; } @@ -964,16 +964,16 @@ static RPCHelpMan getblocktemplate() for (const auto& [name, info] : gbtstatus.locked_in) { block.nVersion |= info.mask; - vbavailable.pushKV(gbt_force_name(name, info.gbt_force), info.bit); - if (!info.gbt_force && !setClientRules.count(name)) { + vbavailable.pushKV(gbt_rule_value(name, info.gbt_optional_rule), info.bit); + if (!info.gbt_optional_rule && !setClientRules.count(name)) { // If the client doesn't support this, don't indicate it in the [default] version block.nVersion &= ~info.mask; } } for (const auto& [name, info] : gbtstatus.active) { - aRules.push_back(gbt_force_name(name, info.gbt_force)); - if (!info.gbt_force && !setClientRules.count(name)) { + aRules.push_back(gbt_rule_value(name, info.gbt_optional_rule)); + if (!info.gbt_optional_rule && !setClientRules.count(name)) { // Not supported by the client; make sure it's safe to proceed throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Support for '%s' rule requires explicit client support", name)); } diff --git a/src/versionbits.cpp b/src/versionbits.cpp index 0aac33ac6f3..32edcd7d95d 100644 --- a/src/versionbits.cpp +++ b/src/versionbits.cpp @@ -235,7 +235,7 @@ BIP9GBTStatus VersionBitsCache::GBTStatus(const CBlockIndex& block_index, const VersionBitsConditionChecker checker(params, pos); ThresholdState state = checker.GetStateFor(&block_index, m_caches[pos]); const VBDeploymentInfo& vbdepinfo = VersionBitsDeploymentInfo[pos]; - BIP9GBTStatus::Info gbtinfo{.bit=params.vDeployments[pos].bit, .mask=checker.Mask(), .gbt_force=vbdepinfo.gbt_force}; + BIP9GBTStatus::Info gbtinfo{.bit=params.vDeployments[pos].bit, .mask=checker.Mask(), .gbt_optional_rule=vbdepinfo.gbt_optional_rule}; switch (state) { case DEFINED: diff --git a/src/versionbits.h b/src/versionbits.h index b3d82e2aac6..abd671b4efd 100644 --- a/src/versionbits.h +++ b/src/versionbits.h @@ -66,7 +66,7 @@ struct BIP9GBTStatus { struct Info { int bit; uint32_t mask; - bool gbt_force; + bool gbt_optional_rule; }; std::map> signalling, locked_in, active; };