aboutsummaryrefslogtreecommitdiff
path: root/src/test/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/util.cpp')
-rw-r--r--src/test/util.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/util.cpp b/src/test/util.cpp
index 2afa88bd2c..64ecc6623a 100644
--- a/src/test/util.cpp
+++ b/src/test/util.cpp
@@ -84,6 +84,7 @@ std::shared_ptr<CBlock> PrepareBlock(const CScript& coinbase_scriptPubKey)
.CreateNewBlock(coinbase_scriptPubKey)
->block);
+ LOCK(cs_main);
block->nTime = ::ChainActive().Tip()->GetMedianTimePast() + 1;
block->hashMerkleRoot = BlockMerkleRoot(*block);