Skip to content

Commit

Permalink
main: Fix unspecified syncer host
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechampine committed Nov 20, 2023
1 parent 1421808 commit 5c9bb25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/walletd/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ func newNode(addr, dir string, chainNetwork string, useUPNP bool) (*node, error)
}
}
}
if host, port, _ := net.SplitHostPort(syncerAddr); host == "" {
// peers will reject us if our hostname is empty, so use loopback
// peers will reject us if our hostname is empty or unspecified, so use loopback
host, port, _ := net.SplitHostPort(syncerAddr)
if ip := net.ParseIP(host); ip == nil || ip.IsUnspecified() {
syncerAddr = net.JoinHostPort("127.0.0.1", port)
}

Expand Down

0 comments on commit 5c9bb25

Please sign in to comment.