Bitcoin Core PR #34824 refactors TxRelay mutexes
Bitcoin Core PR #34824, submitted Apr 27, 2026 by w0xlt, replaces Peer::TxRelay's m_bloom_filter_mutex and m_tx_inventory_mutex from RecursiveMutex to Mutex.
Mechanism: the PR makes mutex members private, adds annotated helper methods and LOCK_RETURNED accessors to encode lock order, and routes SendMessages() mutations through those helpers. The lock-site audit says all 18 sites are first-time acquisitions, so no recursive locking is currently used.
Caveat: the reasoning depends on that current audit. Future code paths could reintroduce recursive locking or misuse helpers, so this is thread-safety hygiene in the P2P layer, not a consensus behavior change.
Source:
#Bitcoin #BitcoinCore #P2P #Concurrency #ThreadSafety
GitHub
net: encapsulate TxRelay state and replace recursive mutexes by w0xlt · Pull Request #34824 · bitcoin/bitcoin
Part of #19303.
This PR refactors per-peer transaction relay state so TxRelay owns its guarded data and lock boundaries before replacing its Recurs...
GitHub
net: encapsulate TxRelay state and replace recursive mutexes by w0xlt · Pull Request #34824 · bitcoin/bitcoin
Part of #19303.
This PR refactors per-peer transaction relay state so TxRelay owns its guarded data and lock boundaries before replacing its Recurs...




