[net] Minor cleanups to asmap #22911

pull jnewbery wants to merge 4 commits into bitcoin:master from jnewbery:2021-09-asmap-cleanup changing 12 files +52 −53
  1. jnewbery commented at 2:46 PM on September 7, 2021: member

    These small cleanups to the asmap code are the first 4 commits from #22910. They're minor improvements that are independently useful whether or not 22910 is merged.

  2. [net] Remove CConnman::Options.m_asmap
    This data member was introduced in ec45646de9e but never used.
    07a9eccb60
  3. [asmap] Remove SanityCheckASMap() from netaddress
    SanityCheckASMap(asmap, bits) simply calls through to SanityCheckASMap(asmap)
    in util/asmap. Update all callers to simply call that function.
    bfdf4ef334
  4. [asmap] Make DecodeAsmap() a utility function
    DecopeAsmap is a pure utility function and doesn't have any
    dependencies on addrman, so move it to util/asmap.
    
    Reviewer hint: use:
    
    `git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`
    9fd5618610
  5. [net] Remove asmap argument from CNode::CopyStats()
    This saves passing around a reference to the asmap std::vector<bool>.
    853c4edb70
  6. DrahtBot added the label P2P on Sep 7, 2021
  7. DrahtBot added the label Utils/log/libs on Sep 7, 2021
  8. fanquake commented at 6:50 AM on September 8, 2021: member

    Concept ACK

  9. naumenkogs commented at 7:34 AM on September 8, 2021: member

    ACK 853c4edb70f897a6a7165abaea4a303d7d448721

  10. practicalswift commented at 7:55 AM on September 8, 2021: contributor

    Concept ACK

  11. theStack approved
  12. theStack commented at 2:16 PM on September 8, 2021: member

    Concept and code-review ACK 853c4edb70f897a6a7165abaea4a303d7d448721 🗺️

    An alternative solution in bfdf4ef334a16ef6108a658bf4f8514754128c18 would be to simply set bits = 128 as default argument for the global SanityCheckASMap function (no need to update callers, deduplicates the magic number).

  13. fanquake approved
  14. fanquake commented at 6:03 AM on September 10, 2021: member

    ACK 853c4edb70f897a6a7165abaea4a303d7d448721

  15. fanquake merged this on Sep 10, 2021
  16. fanquake closed this on Sep 10, 2021

  17. jnewbery deleted the branch on Sep 10, 2021
  18. sidhujag referenced this in commit 1ef82b90fc on Sep 11, 2021
  19. deadalnix referenced this in commit 268d02d37a on Jan 10, 2022
  20. Fabcien referenced this in commit 4efcc3345f on Jan 10, 2022
  21. deadalnix referenced this in commit 67888e5150 on Jan 10, 2022
  22. Fabcien referenced this in commit 682cf70170 on Jan 10, 2022
  23. DrahtBot locked this on Oct 30, 2022

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: 2026-04-13 15:14 UTC

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