net: Clarify that m_addr_local is only set once #30617

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2408-addrLocal changing 3 files +9 −13
  1. maflcko commented at 12:05 pm on August 9, 2024: member

    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 (review)

  2. net: Clarify that m_addr_local is only set once
    Includes a rename from addrLocal to m_addr_local to match the name of
    its corresponding Mutex.
    fa6fe43207
  3. DrahtBot commented at 12:05 pm on August 9, 2024: contributor

    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.

  4. DrahtBot added the label P2P on Aug 9, 2024
  5. fanquake requested review from mzumsande on Aug 12, 2024
  6. achow101 added this to the milestone 28.0 on Aug 12, 2024
  7. achow101 commented at 6:47 pm on August 12, 2024: member
    ACK fa6fe432075df5e0eceb1ccd85038159cc820ccc
  8. mzumsande commented at 6:49 pm on August 12, 2024: contributor
    utACK fa6fe432075df5e0eceb1ccd85038159cc820ccc
  9. maflcko added the label Refactoring on Aug 12, 2024
  10. maflcko commented at 7:43 pm on August 12, 2024: member
    Just to clarify: This should be a refactor (no behavior change for bitcoind users)
  11. glozow commented at 9:07 am on August 13, 2024: member
    ACK fa6fe432075df5e0eceb1ccd85038159cc820ccc
  12. glozow merged this on Aug 13, 2024
  13. glozow closed this on Aug 13, 2024

  14. maflcko deleted the branch on Aug 14, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me