Skip to content

Commit

Permalink
Cleanup for thread safety
Browse files Browse the repository at this point in the history
Compiling with Clang 15 caught an extra unneeded lock
on cs_main and also an unnecessary exclusive lock required
on IsV13Enabled. The gArgs global methods are thread-safe via
the internal cs in ArgsManager.
  • Loading branch information
jamescowens committed Jan 29, 2024
1 parent f6d5554 commit 35dc52e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ inline bool IsV12Enabled(int nHeight)
return nHeight >= Params().GetConsensus().BlockV12Height;
}

inline bool IsV13Enabled(int nHeight) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
inline bool IsV13Enabled(int nHeight)
{
// The argument driven override temporarily here to facilitate testing.

Expand Down
2 changes: 0 additions & 2 deletions src/qt/mrcmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ void MRCModel::refresh() EXCLUSIVE_LOCKS_REQUIRED(cs_main)

// This is similar to createmrcrequest in many ways, but the state tracking is more complicated.

LOCK(cs_main);

// Record initial block height during init run.
if (!m_init_block_height) {
m_init_block_height = pindexBest->nHeight;
Expand Down

0 comments on commit 35dc52e

Please sign in to comment.