HomePhabricator

test: add addpeeraddress "tried", test addrman checks on restart with asmap

Description

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

Details

Provenance
Jon Atack <jon@atack.com>Authored on Sep 14 2021, 10:14
FabienCommitted on Oct 20 2022, 07:14
FabienPushed on Oct 20 2022, 07:14
Reviewer
Restricted Project
Differential Revision
D12313: test: add addpeeraddress "tried", test addrman checks on restart with asmap
Parents
rABCfb3145c23bb7: rpc, test: addpeeraddress test coverage, code simplify/constness
Branches
Unknown
Tags
Unknown