p2p: Add DumpAnchors()
Summary:
This is an implementation of #17326:
- all (currently 2) outbound block-relay-only connections are dumped to anchors.dat file
- on restart a node tries to connect to the addresses from anchors.dat
This PR prevents a type of eclipse attack when an attacker exploits a victim node restart to force it to connect to new, probably adversarial, peers.
This is a backport of core#17428 [1/7]
https://github.com/bitcoin/bitcoin/pull/17428/commits/567008d2a0c95bd972f4031f31647c493d1bc2e8
Test Plan: ninja
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D10507