Skip to content

Commit 19d59c9

Browse files
committed
Merge bitcoin/bitcoin#29882: netbase: clean up Proxy logging
fb4cc5f netbase: clean up Proxy logging (Matthew Zipkin) Pull request description: Follow up to #27375 and see bitcoin/bitcoin#29649 (comment) 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 fb4cc5f laanwj: ACK fb4cc5f Tree-SHA512: f07b9f7f2ea9f4bc01780c09f0b076547108294a1fa7d158a0dd48d6d7351569e461e5cccf232b7b1413ce2e3679668e523e5a7c89cd58c909da76d3dcbc34de
2 parents 19722e3 + fb4cc5f commit 19d59c9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/netbase.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,7 @@ std::unique_ptr<Sock> ConnectDirectly(const CService& dest, bool manual_connecti
632632

633633
std::unique_ptr<Sock> Proxy::Connect() const
634634
{
635-
if (!IsValid()) {
636-
LogPrintf("Cannot connect to invalid Proxy\n");
637-
return {};
638-
}
635+
if (!IsValid()) return {};
639636

640637
if (!m_is_unix_socket) return ConnectDirectly(proxy, /*manual_connection=*/true);
641638

@@ -656,7 +653,6 @@ std::unique_ptr<Sock> Proxy::Connect() const
656653
socklen_t len = sizeof(addrun);
657654

658655
if(!ConnectToSocket(*sock, (struct sockaddr*)&addrun, len, path, /*manual_connection=*/true)) {
659-
LogPrintf("Cannot connect to socket for %s\n", path);
660656
return {};
661657
}
662658

0 commit comments

Comments
 (0)