mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02: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:
parent
77376034d4
commit
49c10a9ca4
3 changed files with 23 additions and 5 deletions
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue