[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

@@ -15,6 +15,11 @@
/* Define a virtual block time, one block per 10 minutes after Nov 14 2014, 0:55:36am */
static int32_t TestTime(int nHeight) { return 1415926536 + 600 * nHeight; }
static int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params)
{
return g_versionbitscache.ComputeBlockVersion(pindexPrev, params);
}
static const std::string StateName(ThresholdState state)
{
switch (state) {