Relax pedantic listen addr matching

Fixes #15.
This commit is contained in:
Matt Joiner 2015-05-20 18:14:42 +10:00
parent ca86b0248e
commit 7f9d6eed78
1 changed files with 2 additions and 6 deletions

View File

@ -160,10 +160,8 @@ func (me *Client) PeerID() string {
func (me *Client) ListenAddr() (addr net.Addr) {
for _, l := range me.listeners {
if addr != nil && l.Addr().String() != addr.String() {
panic(fmt.Sprintf("listeners are on different addresses: %q != %q", l.Addr().String(), addr.String()))
}
addr = l.Addr()
break
}
return
}
@ -487,9 +485,7 @@ func NewClient(cfg *Config) (cl *Client, err error) {
return addr.String()
}
if cfg.ListenAddr == "" {
// IPv6 isn't well supported with blocklists, or with trackers and
// DHT.
return "0.0.0.0:50007"
return ":50007"
}
return cfg.ListenAddr
}