diff options
author | Jon Atack <jon@atack.com> | 2022-01-07 13:10:18 +0100 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-01-07 13:12:17 +0100 |
commit | 1823766fc69a3d57767af11f182826533465f621 (patch) | |
tree | 36777ba5c0495b804346347cd4a7518326d78345 /src | |
parent | 4ada74206a533e14312477f36d5443da5caebba0 (diff) |
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."
Diffstat (limited to 'src')
-rw-r--r-- | src/node/blockstorage.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 8127ebd769..50c3059567 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -340,6 +340,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();) { |