Skip to content

Commit 1823766

Browse files
committed
refactor: add thread safety lock assertion to WriteBlockIndexDB()
The new helper function, BlockManager::WriteBlockIndexDB(), has a thread safety lock annotation in its declaration but is missing the corresponding run-time lock assertion in its definition. Per doc/developer-notes.md: "Combine annotations in function declarations with run-time asserts in function definitions."
1 parent 4ada742 commit 1823766

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node/blockstorage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ void BlockManager::Unload()
340340

341341
bool BlockManager::WriteBlockIndexDB()
342342
{
343+
AssertLockHeld(::cs_main);
343344
std::vector<std::pair<int, const CBlockFileInfo*>> vFiles;
344345
vFiles.reserve(m_dirty_fileinfo.size());
345346
for (std::set<int>::iterator it = m_dirty_fileinfo.begin(); it != m_dirty_fileinfo.end();) {

0 commit comments

Comments
 (0)