Skip to content

RFC: netbase: Remove manual_connection and return the failure reason to callers - #36970

Draft
fjahr wants to merge 3 commits into
bitcoin:masterfrom
fjahr:2026-11-i2p-proxy-log-nomanual
Draft

fjahr wants to merge 3 commits into
bitcoin:masterfrom
fjahr:2026-11-i2p-proxy-log-nomanual

Conversation

@fjahr

@fjahr fjahr commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Based on #36969, only the last commit is new. Draft to see if this direction is wanted. This also came out of discussions in #36759:

The manual_connection flag of ConnectDirectly() only picks the log level of a failed connect(). Callers that are not manual peers, like Tor control, pass true just to get the failure logged, and the caller that knows how much a failure matters never sees the reason.

This removes the flag. ConnectDirectly() returns the failure reason and each caller decides how to log it. The log output stays the same, except that manual peers and Tor control now log every failure reason at info level, including timeouts, which were debug only.

@DrahtBot

DrahtBot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36904 (log: Remove trailing and embedded newlines from log messages by maflcko)
  • #36880 (init: Fix surprising behaviors of negated options by fjahr)
  • #36759 (torcontrol: Improve connection logging by ViniciusCestarii)
  • #36257 (qa: assert_equal -> assert_true/assert_false by hodlinator)
  • #35027 (net: add -outboundbind option for outgoing source address by 8144225309)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/45474031569/job/138729326085
LLM reason (✨ experimental): CI failed because IWYU added a missing #include <util/expected.h> to src/net.cpp, leaving an uncommitted diff that the check rejects.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@DrahtBot

DrahtBot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants