test: add addpeeraddress "tried", test addrman checks on restart with asmap
Summary:
This pull adds a tried argument to RPC addpeeraddress and a regression test for the recent addrman/asmap changes and issue. PR #22697 introduced a reproducible bug in commit 181a120 that fails addrman consistency checks and causes it to significantly lose peer entries when the -asmap configuration option is used. The issue occurs upon bitcoind restart due to an initialization order change in src/init.cpp in that commit, whereby CAddrman asmap is set after deserializing peers.dat, rather than before.
Backport of core#22831.
Note that we never suffered that bug, but still it's worth checking we don't introduce it at a later point in time.
Depends on D12312.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, sdulfari
Reviewed By: #bitcoin_abc, sdulfari
Differential Revision: https://reviews.bitcoinabc.org/D12313