lnd icon indicating copy to clipboard operation
lnd copied to clipboard

Fix externalhosts to advertise both IPv4 and IPv6 addresses

Open wearedood opened this issue 4 months ago • 1 comments

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

📝 Please see our Contribution Guidelines for further guidance.

wearedood avatar Aug 08 '25 19:08 wearedood

@wearedood, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Dec 15 '25 16:12 lightninglabs-deploy