This PR is a follow-up for bitcoin/bitcoin#22778 and bitcoin/bitcoin#24062, and it seems required for bitcoin/bitcoin#24931.
See details in the commit messages.
Could be verified with
$ ./configure CC=clang CXX=clang++ CXXFLAGS='-Wthread-safety -Wthread-safety-negative'
$ make clean
$ make 2>&1 | grep m_most_recent_block_mutex
Could be verified with
$ ./configure CC=clang CXX=clang++ CXXFLAGS='-Wthread-safety -Wthread-safety-negative'
$ make clean
$ make 2>&1 | grep m_tx_relay_mutex
471@@ -472,15 +472,16 @@ class PeerManagerImpl final : public PeerManager
472 EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
473 void BlockChecked(const CBlock& block, const BlockValidationState& state) override
474 EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
475- void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) override;
476+ void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) override
477+ EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex);
hebasto
MarcoFalke
ajtowns
jonatack
w0xlt
Labels
Refactoring
P2P