[refactor] Move ComputeBlockVersion into VersionBitsCache

This also changes ComputeBlockVersion to take the versionbits cache
mutex once, rather than once for each versionbits deployment.
This commit is contained in:
Anthony Towns
2021-04-16 18:34:34 +10:00
parent 4a69b4dbe0
commit c5f36725e8
5 changed files with 16 additions and 12 deletions

View File

@@ -1627,7 +1627,7 @@ public:
return pindex->nHeight >= params.MinBIP9WarningHeight &&
((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) &&
((pindex->nVersion >> bit) & 1) != 0 &&
((ComputeBlockVersion(pindex->pprev, params) >> bit) & 1) == 0;
((g_versionbitscache.ComputeBlockVersion(pindex->pprev, params) >> bit) & 1) == 0;
}
};