aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2021-04-16 18:34:34 +1000
committerAnthony Towns <aj@erisian.com.au>2021-06-30 08:19:12 +1000
commitc5f36725e877d8eb492383844f8ef7535466b366 (patch)
treece68ede5ada96fed4a558a1f88e7354e4a1ac3b7 /src/test
parent4a69b4dbe0d7f504811b67c399da7e6d11e4f805 (diff)
downloadbitcoin-c5f36725e877d8eb492383844f8ef7535466b366.tar.xz
[refactor] Move ComputeBlockVersion into VersionBitsCache
This also changes ComputeBlockVersion to take the versionbits cache mutex once, rather than once for each versionbits deployment.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/versionbits_tests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp
index 946b35f3b9..60a8373cf4 100644
--- a/src/test/versionbits_tests.cpp
+++ b/src/test/versionbits_tests.cpp
@@ -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) {