net: add LogIP() helper, use in net_processing

This commit is contained in:
Sjors Provoost
2024-07-23 12:52:38 +02:00
parent 937ef9eb40
commit 1d01ad4d73
3 changed files with 16 additions and 7 deletions

View File

@@ -947,6 +947,14 @@ public:
std::string ConnectionTypeAsString() const { return ::ConnectionTypeAsString(m_conn_type); }
/**
* Helper function to optionally log the IP address.
*
* @param[in] log_ip whether to include the IP address
* @return " peeraddr=..." or ""
*/
std::string LogIP(bool log_ip) const;
/**
* Helper function to log disconnects.
*