This PR builds on PR #16702 to add functional tests / sanity checks and user-facing refinements for passing -asmap to configure ASN-based IP bucketing in addrman. As per our review discussion in that PR, the idea here is to handle aspects like functional tests and config arg handling that can help the PR be merged while enabling the author to focus on the bucketing itself.
add feature functional tests to verify node behaviour and debug log output when launching
bitcoindwith no-asmapargbitcoind -asmap=RELATIVE_FILENAMEto the unit test data skeleton asmapbitcoind -asmapwith no filename specified using the default asmap filebitcoind -asmapwith no filename specified and a missing default asmap file
add the ability to pass absolute path filenames to the
-asmapconfig arg in addition to datadir-relative path filenames as per #16702 (review), and add test coverageseparate the asmap file finding and parsing checks, which allows adding tests for the case of a found but unparseable or empty asmap
add test for an empty asmap
various asmap fixups
move the asmap init code earlier in the init process to provide immediate feedback when passing an
-asmapconfig arg. This speeds up thefeature_asmapfunctional test from 60 to 5 seconds! Credit to Wladimir J. van der Laan for the suggestion.