lnd
lnd copied to clipboard
Fix externalhosts to advertise both IPv4 and IPv6 addresses
Fixes #8801
When a domain resolves to both IPv4 and IPv6 addresses, the node should advertise both protocols. Previously, only one address was returned due to using ResolveTCPAddr which returns a single address.
This change:
- Uses net.LookupHost to get all IP addresses for a domain
- Creates addresses for each IP found (both IPv4 and IPv6)
- Handles errors gracefully by continuing with other IPs if one fails
- Returns error if no valid addresses are found
- Updates function signature to return []net.Addr instead of single net.Addr
Change Description
Description of change / link to associated issue.
Steps to Test
Steps for reviewers to follow to test the change.
Pull Request Checklist
Testing
- [ ] Your PR passes all CI checks.
- [ ] Tests covering the positive and negative (error paths) are included.
- [ ] Bug fixes contain tests triggering the bug to prevent regressions.
Code Style and Documentation
- [ ] The change is not insubstantial. Typo fixes are not accepted to fight bot spam.
- [ ] The change obeys the Code Documentation and Commenting guidelines, and lines wrap at 80.
- [ ] Commits follow the Ideal Git Commit Structure.
- [ ] Any new logging statements use an appropriate subsystem and logging level.
- [ ] Any new lncli commands have appropriate tags in the comments for the rpc in the proto file.
- [ ] There is a change description in the release notes, or
[skip ci]in the commit message for small changes.
📝 Please see our Contribution Guidelines for further guidance.
@wearedood, remember to re-request review from reviewers when ready