mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
[log] Add connection type to log statement
In addition to adding more specificity to the log statement about the type of connection, this change also consolidates two statements into one. Previously, the second one should have never been hit, since block-relay connections would match the "!IsInboundConn()" condition and return early.
This commit is contained in:
20
src/net.cpp
20
src/net.cpp
@@ -488,6 +488,26 @@ void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNet
|
||||
}
|
||||
}
|
||||
|
||||
std::string CNode::ConnectionTypeAsString() const
|
||||
{
|
||||
switch (m_conn_type) {
|
||||
case ConnectionType::INBOUND:
|
||||
return "inbound";
|
||||
case ConnectionType::MANUAL:
|
||||
return "manual";
|
||||
case ConnectionType::FEELER:
|
||||
return "feeler";
|
||||
case ConnectionType::OUTBOUND_FULL_RELAY:
|
||||
return "outbound-full-relay";
|
||||
case ConnectionType::BLOCK_RELAY:
|
||||
return "block-relay-only";
|
||||
case ConnectionType::ADDR_FETCH:
|
||||
return "addr-fetch";
|
||||
} // no default case, so the compiler can warn about missing cases
|
||||
|
||||
assert(false);
|
||||
}
|
||||
|
||||
std::string CNode::GetAddrName() const {
|
||||
LOCK(cs_addrName);
|
||||
return addrName;
|
||||
|
||||
Reference in New Issue
Block a user