1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-07-01 00:00:23 +08:00

fix(p2p): handle error on parsing endpoint

This commit is contained in:
源文雨
2024-07-17 00:10:43 +09:00
parent 7d25f46813
commit 1c665c68fb
5 changed files with 19 additions and 14 deletions

View File

@@ -44,7 +44,8 @@ func (conn *Conn) String() string {
}
func (conn *Conn) LocalAddr() p2p.EndPoint {
return NewEndpoint((*net.UDPConn)(conn).LocalAddr().String())
ep, _ := NewEndpoint((*net.UDPConn)(conn).LocalAddr().String())
return ep
}
func (conn *Conn) ReadFromPeer(b []byte) (int, p2p.EndPoint, error) {