mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 18:53:21 +01:00
net: Clarify that m_addr_local is only set once
Includes a rename from addrLocal to m_addr_local to match the name of its corresponding Mutex.
This commit is contained in:
@@ -576,16 +576,14 @@ CService CNode::GetAddrLocal() const
|
||||
{
|
||||
AssertLockNotHeld(m_addr_local_mutex);
|
||||
LOCK(m_addr_local_mutex);
|
||||
return addrLocal;
|
||||
return m_addr_local;
|
||||
}
|
||||
|
||||
void CNode::SetAddrLocal(const CService& addrLocalIn) {
|
||||
AssertLockNotHeld(m_addr_local_mutex);
|
||||
LOCK(m_addr_local_mutex);
|
||||
if (addrLocal.IsValid()) {
|
||||
LogError("Addr local already set for node: %i. Refusing to change from %s to %s\n", id, addrLocal.ToStringAddrPort(), addrLocalIn.ToStringAddrPort());
|
||||
} else {
|
||||
addrLocal = addrLocalIn;
|
||||
if (Assume(!m_addr_local.IsValid())) { // Addr local can only be set once during version msg processing
|
||||
m_addr_local = addrLocalIn;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user