2 suggestions
Optional improvements
[suggestion] · Tor control connection-failure log levels lack regression coverage
Existing tests do not assert connection-failure log levels, so restoring the warning or unconditional Info messages would escape their assertions.
Location: src/torcontrol.cpp:98 (head).
Details and suggested fix
The dedicated Tor-control test starts its mock listener before restarting the node, and its reconnect case checks timing and commands while the listener remains available. Any refused retries after mock cleanup have no logging assertions. p2p_private_broadcast.py does configure an unavailable control port, but checks only the RPC error. Add a focused functional case using -listenonion=1 -torcontrol=127.0.0.1:<unused port>. Use assert_debug_log to require both TOR-category failure messages and reject their former warning forms and the uncategorized Info-level socket failure, while allowing the NET debug form. Functional nodes already enable debug logging, so category and severity prefixes can distinguish these forms without new framework support.
[suggestion] · Tor-only debugging loses the socket error reason
Passing manual_connection=false moves socket-error details such as “Connection refused” into NET debug logging, leaving operators using the documented -debug=tor option with only generic connection-failure messages.
Location: src/torcontrol.cpp:98 (head).
Details and suggested fix
Previously, LogConnectFailure printed immediate and post-wait socket errors unconditionally at Info level. This call now sends those details to BCLog::NET, while the TOR messages report only the address and failed attempt. Keep the reason available at Debug level under TOR, for example by letting the caller select the debug category through ConnectDirectly and LogConnectFailure. That requires shared-API plumbing but preserves quiet default logging and avoids requiring the higher-volume -debug=net workaround. This is a small diagnostic tradeoff, not a loss of long-standing functionality: timeouts and wait failures were already NET-only, and the older libevent implementation logged only a generic TOR connection error.