refactor: Propagate negative !m_tx_relay_mutex capability

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
This commit is contained in:
Hennadii Stepanov
2022-05-20 13:31:08 +02:00
parent 5a6e3c1db3
commit 2b3373c152

View File

@@ -283,7 +283,7 @@ struct Peer {
};
/* Initializes a TxRelay struct for this peer. Can be called at most once for a peer. */
TxRelay* SetTxRelay()
TxRelay* SetTxRelay() EXCLUSIVE_LOCKS_REQUIRED(!m_tx_relay_mutex)
{
LOCK(m_tx_relay_mutex);
Assume(!m_tx_relay);