Commit 900a4d7e authored by aarshkshah1992's avatar aarshkshah1992

fix local addr use

parent d18c05e0
......@@ -255,7 +255,15 @@ func (l *maListener) Accept() (Conn, error) {
}
}
return wrap(nconn, l.laddr, raddr), nil
var laddr ma.Multiaddr
if nconn.LocalAddr().String() != "" {
laddr, err = FromNetAddr(nconn.LocalAddr())
if err != nil {
return nil, fmt.Errorf("failed to convert conn.LocalAddr: %s", err)
}
}
return wrap(nconn, laddr, raddr), nil
}
// Multiaddr returns the listener's (local) Multiaddr.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment