merge bitcoin#24002: add thread safety lock assertion to WriteBlockIndexDB()

This commit is contained in:
Kittywhiskers Van Gogh 2022-01-07 13:10:18 +01:00
parent 04a3f65032
commit e5e37458bb
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -331,6 +331,7 @@ void BlockManager::Unload()
bool BlockManager::WriteBlockIndexDB()
{
AssertLockHeld(::cs_main);
std::vector<std::pair<int, const CBlockFileInfo*>> vFiles;
vFiles.reserve(m_dirty_fileinfo.size());
for (std::set<int>::iterator it = m_dirty_fileinfo.begin(); it != m_dirty_fileinfo.end();) {