[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

@@ -93,12 +93,11 @@ public:
/** Get the block height at which the BIP9 deployment switched into the state for the block after pindexPrev. */
int StateSinceHeight(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos);
/** Determine what nVersion a new block should use
*/
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params);
void Clear();
};
/**
* Determine what nVersion a new block should use.
*/
int32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params);
#endif // BITCOIN_VERSIONBITS_H