aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-04-24 19:14:48 +0800
committermerge-script <fanquake@gmail.com>2024-04-24 19:14:48 +0800
commit19d59c9cc6078df7927eec3fe34a292121909041 (patch)
tree4a2277007fb03e3333f7037ff2714f99d92d2c6e /src/netbase.cpp
parent19722e3e728933e629eb8e407075fb193b2908e2 (diff)
parentfb4cc5f423ce587c1e97377e8afdf92fb4850f59 (diff)
Merge bitcoin/bitcoin#29882: netbase: clean up Proxy logging
fb4cc5f423ce587c1e97377e8afdf92fb4850f59 netbase: clean up Proxy logging (Matthew Zipkin) Pull request description: Follow up to #27375 and see https://github.com/bitcoin/bitcoin/pull/29649#issuecomment-2057456834 This removes an extra log message when we can't connect to our own proxy, and another when the proxy is invalid. ## Before #27375 if proxy is unreachable ``` 2024-04-15T17:54:51Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61) 2024-04-15T17:54:52Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61) 2024-04-15T17:54:52Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61) 2024-04-15T17:54:53Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61) 2024-04-15T17:54:53Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61) ``` ## After #27375 if unix proxy is unreachable: ``` 2024-04-15T17:54:03Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) 2024-04-15T17:54:03Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor 2024-04-15T17:54:04Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) 2024-04-15T17:54:04Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor 2024-04-15T17:54:04Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) 2024-04-15T17:54:04Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor 2024-04-15T17:54:05Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) 2024-04-15T17:54:05Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor ``` ## After this PR: ``` 2024-04-15T18:18:51Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) 2024-04-15T18:18:51Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) 2024-04-15T18:18:52Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) 2024-04-15T18:18:52Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2) ``` ACKs for top commit: tdb3: CR ACK for fb4cc5f423ce587c1e97377e8afdf92fb4850f59 laanwj: ACK fb4cc5f423ce587c1e97377e8afdf92fb4850f59 Tree-SHA512: f07b9f7f2ea9f4bc01780c09f0b076547108294a1fa7d158a0dd48d6d7351569e461e5cccf232b7b1413ce2e3679668e523e5a7c89cd58c909da76d3dcbc34de
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index 3ca1a5227a..f0fa298378 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -632,10 +632,7 @@ std::unique_ptr<Sock> ConnectDirectly(const CService& dest, bool manual_connecti
std::unique_ptr<Sock> Proxy::Connect() const
{
- if (!IsValid()) {
- LogPrintf("Cannot connect to invalid Proxy\n");
- return {};
- }
+ if (!IsValid()) return {};
if (!m_is_unix_socket) return ConnectDirectly(proxy, /*manual_connection=*/true);
@@ -656,7 +653,6 @@ std::unique_ptr<Sock> Proxy::Connect() const
socklen_t len = sizeof(addrun);
if(!ConnectToSocket(*sock, (struct sockaddr*)&addrun, len, path, /*manual_connection=*/true)) {
- LogPrintf("Cannot connect to socket for %s\n", path);
return {};
}