File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ ChainTestingSetup::~ChainTestingSetup()
180
180
m_node.banman .reset ();
181
181
m_node.addrman .reset ();
182
182
m_node.args = nullptr ;
183
- UnloadBlockIndex (m_node.mempool .get (), *m_node.chainman );
183
+ WITH_LOCK (::cs_main, UnloadBlockIndex (m_node.mempool .get (), *m_node.chainman ) );
184
184
m_node.mempool .reset ();
185
185
m_node.scheduler .reset ();
186
186
m_node.chainman ->Reset ();
Original file line number Diff line number Diff line change @@ -4028,7 +4028,7 @@ void CChainState::UnloadBlockIndex() {
4028
4028
// block index state
4029
4029
void UnloadBlockIndex (CTxMemPool* mempool, ChainstateManager& chainman)
4030
4030
{
4031
- LOCK ( cs_main);
4031
+ AssertLockHeld (:: cs_main);
4032
4032
chainman.Unload ();
4033
4033
pindexBestHeader = nullptr ;
4034
4034
if (mempool) mempool->clear ();
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ extern CBlockIndex *pindexBestHeader;
138
138
extern const std::vector<std::string> CHECKLEVEL_DOC;
139
139
140
140
/* * Unload database information */
141
- void UnloadBlockIndex (CTxMemPool* mempool, ChainstateManager& chainman);
141
+ void UnloadBlockIndex (CTxMemPool* mempool, ChainstateManager& chainman) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) ;
142
142
/* * Run instances of script checking worker threads */
143
143
void StartScriptCheckWorkerThreads (int threads_num);
144
144
/* * Stop all of the script checking worker threads */
You can’t perform that action at this time.
0 commit comments