Add --address, bind to specific address
Summary:
Backport of https://github.com/sipa/bitcoin-seeder/pull/84
Some configurations need to bind a specific address. See issues referenced in the original pull request.
I had to modify the original pull request to match the ABC code base.
Test Plan:
Test cases:
./bitcoin-seeder -host=localhost -ns=localhost -mbox=thonkle@protonmail.com -port=5555 ./bitcoin-seeder -host=localhost -ns=localhost -mbox=thonkle@protonmail.com -port=5555 -address=127.0.0.1 ./bitcoin-seeder -host=localhost -ns=localhost -mbox=thonkle@protonmail.com -port=5555 -address=::1
Results of sudo netstat -pln | grep 5555 for each test case:
udp6 0 0 :::5555 :::* 18998/./bitcoin-see udp6 0 0 127.0.0.1:5555 :::* 19121/./bitcoin-see udp6 0 0 ::1:5555 :::* 19361/./bitcoin-see
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10186