Fix CreateNewBlock_validity by not holding cs_main when calling createAndProcessEmptyBlock
This commit is contained in:
parent
95192d5b56
commit
72af215a36
@ -257,6 +257,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
createAndProcessEmptyBlock();
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(cs_main);
|
||||
|
||||
// Just to make sure we can still make simple blocks
|
||||
@ -507,9 +508,13 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
for (int i = 0; i < CBlockIndex::nMedianTimeSpan; i++)
|
||||
chainActive.Tip()->GetAncestor(chainActive.Tip()->nHeight - i)->nTime += 512; //Trick the MedianTimePast
|
||||
|
||||
} // unlock cs_main while calling createAndProcessEmptyBlock
|
||||
|
||||
// Mine an empty block
|
||||
createAndProcessEmptyBlock();
|
||||
|
||||
LOCK(cs_main);
|
||||
|
||||
SetMockTime(chainActive.Tip()->GetMedianTimePast() + 1);
|
||||
|
||||
BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));
|
||||
|
Loading…
Reference in New Issue
Block a user