Page MenuHomePhabricator

Add --address, bind to specific address
ClosedPublic

Authored by thonkle on Sep 22 2021, 18:59.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCe7f7ed186ec0: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sep 22 2021, 18:59
thonkle requested review of this revision.Sep 22 2021, 18:59
Fabien requested changes to this revision.Sep 23 2021, 07:26
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/seeder/main.cpp
105 ↗(On Diff #30129)

Can you please add a comment about that ? Something like "The address can be either IPv4 or IPv6 but the seeder only uses IPv6 internally, so it needs to be converted to IPv6"

155 ↗(On Diff #30129)

You just created a constant for the default, better use it

This revision now requires changes to proceed.Sep 23 2021, 07:26
src/seeder/main.cpp
105 ↗(On Diff #30129)

Ok

155 ↗(On Diff #30129)

Other args help text can use similar improvement. Do you prefer this in a separate patch?

  • Added comment about IPv6 transformation
  • Use constant for args help text
Fabien added inline comments.
src/seeder/main.cpp
155 ↗(On Diff #30129)

That would be great

This revision is now accepted and ready to land.Sep 28 2021, 18:54
This revision was automatically updated to reflect the committed changes.