Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Aug 9, 2024

The function is supposed to be only called once when the version msg arrives (a single time). Calling it twice would be an internal logic bug. However, the LogError in this function has many issues:

  • If the error happens in tests, as is the case for the buggy fuzz test, it will go unnoticed
  • It is dead code, unless a bug is introduced to execute it

Fix all issues by using Assume(!m_addr_local.IsValid()) instead. Idea taken from #30364 (comment)

Includes a rename from addrLocal to m_addr_local to match the name of
its corresponding Mutex.
@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 9, 2024

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK achow101, mzumsande, glozow

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #29418 (rpc: provide per message stats for global traffic via new RPC 'getnetmsgstats' by vasild)

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.

@achow101
Copy link
Member

ACK fa6fe43

Copy link
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fa6fe43

@maflcko
Copy link
Member Author

maflcko commented Aug 12, 2024

Just to clarify: This should be a refactor (no behavior change for bitcoind users)

Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa6fe43

@glozow glozow merged commit 7583eac into bitcoin:master Aug 13, 2024
@maflcko maflcko deleted the 2408-addrLocal branch August 14, 2024 07:54
@bitcoin bitcoin locked and limited conversation to collaborators Aug 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants