mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
validation: move g_versionbitscache into ChainstateManager
This commit is contained in:
@@ -836,7 +836,7 @@ static RPCHelpMan getblocktemplate()
|
||||
UniValue vbavailable(UniValue::VOBJ);
|
||||
for (int j = 0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) {
|
||||
Consensus::DeploymentPos pos = Consensus::DeploymentPos(j);
|
||||
ThresholdState state = g_versionbitscache.State(pindexPrev, consensusParams, pos);
|
||||
ThresholdState state = chainman.m_versionbitscache.State(pindexPrev, consensusParams, pos);
|
||||
switch (state) {
|
||||
case ThresholdState::DEFINED:
|
||||
case ThresholdState::FAILED:
|
||||
@@ -844,7 +844,7 @@ static RPCHelpMan getblocktemplate()
|
||||
break;
|
||||
case ThresholdState::LOCKED_IN:
|
||||
// Ensure bit is set in block version
|
||||
pblock->nVersion |= g_versionbitscache.Mask(consensusParams, pos);
|
||||
pblock->nVersion |= chainman.m_versionbitscache.Mask(consensusParams, pos);
|
||||
[[fallthrough]];
|
||||
case ThresholdState::STARTED:
|
||||
{
|
||||
@@ -853,7 +853,7 @@ static RPCHelpMan getblocktemplate()
|
||||
if (setClientRules.find(vbinfo.name) == setClientRules.end()) {
|
||||
if (!vbinfo.gbt_force) {
|
||||
// If the client doesn't support this, don't indicate it in the [default] version
|
||||
pblock->nVersion &= ~g_versionbitscache.Mask(consensusParams, pos);
|
||||
pblock->nVersion &= ~chainman.m_versionbitscache.Mask(consensusParams, pos);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user