HomePhabricator

Limit the number of IPs we use from each DNS seeder

Description

Limit the number of IPs we use from each DNS seeder

Summary:
A risk exists where a malicious DNS seeder eclipses a node by returning an enormous number of IP addresses. In this commit we mitigate this risk by limiting the number of IP addresses addrman learns to 256 per DNS seeder.

This is a backprot of core PR12626

Depends on D1881

Test Plan:

make check

Start a node, see it connects to the network as expected.

Reviewers: #bitcoin_abc, schancel

Reviewed By: #bitcoin_abc, schancel

Subscribers: teamcity

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