diff --git a/src/test/test_dash.cpp b/src/test/test_dash.cpp index c494bcb3e3..f5b6ea2924 100644 --- a/src/test/test_dash.cpp +++ b/src/test/test_dash.cpp @@ -204,7 +204,10 @@ CBlock TestChainSetup::CreateBlock(const std::vector& txns, // IncrementExtraNonce creates a valid coinbase and merkleRoot unsigned int extraNonce = 0; - IncrementExtraNonce(&block, chainActive.Tip(), extraNonce); + { + LOCK(cs_main); + IncrementExtraNonce(&block, chainActive.Tip(), extraNonce); + } while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;