mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 10:30:08 +01:00
Remove unused RecursiveMutex cs_addrName
This commit is contained in:
parent
fa82f4ea96
commit
fa786570a5
2 changed files with 7 additions and 9 deletions
10
src/net.cpp
10
src/net.cpp
|
@ -530,9 +530,9 @@ std::string ConnectionTypeAsString(ConnectionType conn_type)
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CNode::GetAddrName() const {
|
std::string CNode::GetAddrName() const
|
||||||
LOCK(cs_addrName);
|
{
|
||||||
return addrName;
|
return m_addr_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
CService CNode::GetAddrLocal() const
|
CService CNode::GetAddrLocal() const
|
||||||
|
@ -2956,6 +2956,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const
|
||||||
: nTimeConnected(GetTimeSeconds()),
|
: nTimeConnected(GetTimeSeconds()),
|
||||||
addr(addrIn),
|
addr(addrIn),
|
||||||
addrBind(addrBindIn),
|
addrBind(addrBindIn),
|
||||||
|
m_addr_name{addrNameIn.empty() ? addr.ToStringIPPort() : addrNameIn},
|
||||||
m_inbound_onion(inbound_onion),
|
m_inbound_onion(inbound_onion),
|
||||||
nKeyedNetGroup(nKeyedNetGroupIn),
|
nKeyedNetGroup(nKeyedNetGroupIn),
|
||||||
id(idIn),
|
id(idIn),
|
||||||
|
@ -2965,7 +2966,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const
|
||||||
{
|
{
|
||||||
if (inbound_onion) assert(conn_type_in == ConnectionType::INBOUND);
|
if (inbound_onion) assert(conn_type_in == ConnectionType::INBOUND);
|
||||||
hSocket = hSocketIn;
|
hSocket = hSocketIn;
|
||||||
addrName = addrNameIn == "" ? addr.ToStringIPPort() : addrNameIn;
|
|
||||||
if (conn_type_in != ConnectionType::BLOCK_RELAY) {
|
if (conn_type_in != ConnectionType::BLOCK_RELAY) {
|
||||||
m_tx_relay = std::make_unique<TxRelay>();
|
m_tx_relay = std::make_unique<TxRelay>();
|
||||||
}
|
}
|
||||||
|
@ -2975,7 +2975,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const
|
||||||
mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0;
|
mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0;
|
||||||
|
|
||||||
if (fLogIPs) {
|
if (fLogIPs) {
|
||||||
LogPrint(BCLog::NET, "Added connection to %s peer=%d\n", addrName, id);
|
LogPrint(BCLog::NET, "Added connection to %s peer=%d\n", m_addr_name, id);
|
||||||
} else {
|
} else {
|
||||||
LogPrint(BCLog::NET, "Added connection peer=%d\n", id);
|
LogPrint(BCLog::NET, "Added connection peer=%d\n", id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,6 +430,7 @@ public:
|
||||||
const CAddress addr;
|
const CAddress addr;
|
||||||
// Bind address of our side of the connection
|
// Bind address of our side of the connection
|
||||||
const CAddress addrBind;
|
const CAddress addrBind;
|
||||||
|
const std::string m_addr_name;
|
||||||
//! Whether this peer is an inbound onion, i.e. connected via our Tor onion service.
|
//! Whether this peer is an inbound onion, i.e. connected via our Tor onion service.
|
||||||
const bool m_inbound_onion;
|
const bool m_inbound_onion;
|
||||||
std::atomic<int> nVersion{0};
|
std::atomic<int> nVersion{0};
|
||||||
|
@ -691,10 +692,7 @@ private:
|
||||||
//! service advertisements.
|
//! service advertisements.
|
||||||
const ServiceFlags nLocalServices;
|
const ServiceFlags nLocalServices;
|
||||||
|
|
||||||
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
|
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
|
||||||
|
|
||||||
mutable RecursiveMutex cs_addrName;
|
|
||||||
std::string addrName GUARDED_BY(cs_addrName);
|
|
||||||
|
|
||||||
// Our address, as reported by the peer
|
// Our address, as reported by the peer
|
||||||
CService addrLocal GUARDED_BY(cs_addrLocal);
|
CService addrLocal GUARDED_BY(cs_addrLocal);
|
||||||
|
|
Loading…
Add table
Reference in a new issue