From e5e37458bb69a47a04d10bfb8021388663abead8 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Fri, 7 Jan 2022 13:10:18 +0100 Subject: [PATCH] merge bitcoin#24002: add thread safety lock assertion to WriteBlockIndexDB() --- src/node/blockstorage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 9c3475e0e7..120b86d23e 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -331,6 +331,7 @@ void BlockManager::Unload() bool BlockManager::WriteBlockIndexDB() { + AssertLockHeld(::cs_main); std::vector> vFiles; vFiles.reserve(m_dirty_fileinfo.size()); for (std::set::iterator it = m_dirty_fileinfo.begin(); it != m_dirty_fileinfo.end();) {