HomePhabricator

[init] Read/decode asmap before constructing addrman

Description

[init] Read/decode asmap before constructing addrman

Summary:

Commit 181a1207 introduced an initialization order bug: CAddrMan's m_asmap must be set before deserializing peers.dat. Restore that ordering.

Note that we didn't introduce the bug (yet), mostly because most of the referenced PR is not relevant for us so it has been purposedly delayed. A note is added to the code so that later backport will not introduce more issues.

Partial backport of core#22791:
https://github.com/bitcoin/bitcoin/pull/22791/commits/50fd77045e2f858a53486b5e02e1798c92ab946c

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D12291

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Aug 24 2021, 08:49
FabienCommitted on Oct 18 2022, 20:13
FabienPushed on Oct 18 2022, 20:13
Reviewer
Restricted Project
Differential Revision
D12291: [init] Read/decode asmap before constructing addrman
Parents
rABC080be4129500: [avalanche] Separate pubkey from AvalancheState
Branches
Unknown
Tags
Unknown