mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
test: Fix intermittent failure in ChainStateManager tests
Before wiping the ChainStateManager, the validationinterface queue must be drained to avoid accessing deleted memory.
This commit is contained in:
parent
b759cefe93
commit
f8abcb3e3b
1 changed files with 4 additions and 1 deletions
|
@ -367,10 +367,13 @@ struct SnapshotTestSetup : TestChain100Setup {
|
|||
|
||||
BOOST_TEST_MESSAGE("Simulating node restart");
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
for (Chainstate* cs : chainman.GetAll()) {
|
||||
LOCK(::cs_main);
|
||||
cs->ForceFlushStateToDisk();
|
||||
}
|
||||
// Process all callbacks referring to the old manager before wiping it.
|
||||
SyncWithValidationInterfaceQueue();
|
||||
LOCK(::cs_main);
|
||||
chainman.ResetChainstates();
|
||||
BOOST_CHECK_EQUAL(chainman.GetAll().size(), 0);
|
||||
const ChainstateManager::Options chainman_opts{
|
||||
|
|
Loading…
Add table
Reference in a new issue