mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-09 01:40:27 +02:00
Merge bitcoin/bitcoin#24108: Replace RecursiveMutex cs_addrLocal
with Mutex, and rename it
dec787d8ac
refactor: replace RecursiveMutex `m_addr_local_mutex` with Mutex (w0xlt)93609c1dfa
p2p: add assertions and negative TS annotations for m_addr_local_mutex (w0xlt)c4a31ca267
scripted-diff: rename cs_addrLocal -> m_addr_local_mutex (w0xlt) Pull request description: This PR is related to #19303 and gets rid of the `RecursiveMutex cs_addrLocal`. ACKs for top commit: hebasto: ACKdec787d8ac
, I have reviewed the code and it looks OK, I agree it can be merged. shaavan: reACKdec787d8ac
Tree-SHA512: b7a043bfd4e2ccbe313bff21ad815169db6ad215ca96daf358ce960c496a548b4a9e90be9e4357430ca59652b96df87c097450118996c6d4703cbaabde2072d0
This commit is contained in:
@ -553,12 +553,14 @@ std::string ConnectionTypeAsString(ConnectionType conn_type)
|
||||
|
||||
CService CNode::GetAddrLocal() const
|
||||
{
|
||||
LOCK(cs_addrLocal);
|
||||
AssertLockNotHeld(m_addr_local_mutex);
|
||||
LOCK(m_addr_local_mutex);
|
||||
return addrLocal;
|
||||
}
|
||||
|
||||
void CNode::SetAddrLocal(const CService& addrLocalIn) {
|
||||
LOCK(cs_addrLocal);
|
||||
AssertLockNotHeld(m_addr_local_mutex);
|
||||
LOCK(m_addr_local_mutex);
|
||||
if (addrLocal.IsValid()) {
|
||||
error("Addr local already set for node: %i. Refusing to change from %s to %s", id, addrLocal.ToString(), addrLocalIn.ToString());
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user