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.
[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-
jnewbery commented at 2:46 PM on September 7, 2021: member
-
07a9eccb60
[net] Remove CConnman::Options.m_asmap
This data member was introduced in ec45646de9e but never used.
-
bfdf4ef334
[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.
-
9fd5618610
[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`
-
853c4edb70
[net] Remove asmap argument from CNode::CopyStats()
This saves passing around a reference to the asmap std::vector<bool>.
- DrahtBot added the label P2P on Sep 7, 2021
- DrahtBot added the label Utils/log/libs on Sep 7, 2021
-
fanquake commented at 6:50 AM on September 8, 2021: member
Concept ACK
-
naumenkogs commented at 7:34 AM on September 8, 2021: member
ACK 853c4edb70f897a6a7165abaea4a303d7d448721
-
practicalswift commented at 7:55 AM on September 8, 2021: contributor
Concept ACK
- theStack approved
-
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 = 128as default argument for the globalSanityCheckASMapfunction (no need to update callers, deduplicates the magic number). - fanquake approved
-
fanquake commented at 6:03 AM on September 10, 2021: member
ACK 853c4edb70f897a6a7165abaea4a303d7d448721
- fanquake merged this on Sep 10, 2021
- fanquake closed this on Sep 10, 2021
- jnewbery deleted the branch on Sep 10, 2021
- sidhujag referenced this in commit 1ef82b90fc on Sep 11, 2021
- deadalnix referenced this in commit 268d02d37a on Jan 10, 2022
- Fabcien referenced this in commit 4efcc3345f on Jan 10, 2022
- deadalnix referenced this in commit 67888e5150 on Jan 10, 2022
- Fabcien referenced this in commit 682cf70170 on Jan 10, 2022
- DrahtBot locked this on Oct 30, 2022