Add public seed nodes and ignore version-rolling bits

This commit is contained in:
Capri 2026-07-27 20:25:29 +00:00
commit e0458056fd
Signed by: VextaProject
SSH key fingerprint: SHA256:739BZv8LvIDY2tR7lXLy/IQ6MaGTQtYcG9GNvCjmpVM
2 changed files with 14 additions and 6 deletions

View file

@ -2257,15 +2257,21 @@ void CChainState::UpdateTip(const CBlockIndex* pindexNew)
}
}
// Check the version of the last 100 blocks to see if we need to upgrade:
// Check the version of the last 100 blocks to see if we need to upgrade.
// Ignore bits reserved for BIP310 version rolling / overt ASICBoost.
static constexpr uint32_t VERSION_ROLLING_MASK = 0x1fffe000;
for (int i = 0; i < 100 && pindex != nullptr; i++)
{
int32_t nExpectedVersion = g_versionbitscache.ComputeBlockVersion(pindex->pprev, m_params.GetConsensus());
if (pindex->nVersion > VERSIONBITS_LAST_OLD_BLOCK_VERSION && (pindex->nVersion & ~nExpectedVersion) != 0)
const int32_t nExpectedVersion = g_versionbitscache.ComputeBlockVersion(pindex->pprev, m_params.GetConsensus());
const uint32_t unexpectedBits =
(static_cast<uint32_t>(pindex->nVersion) &
~static_cast<uint32_t>(nExpectedVersion)) &
~VERSION_ROLLING_MASK;
if (pindex->nVersion > VERSIONBITS_LAST_OLD_BLOCK_VERSION && unexpectedBits != 0)
{
++nUpgraded;
// SHA256D blocks with weird versions could simply be the result
// of overt AsicBoost.
}
pindex = pindex->pprev;
}