From 06cc0f76455d7a55ae57fb268a6f767899771f32 Mon Sep 17 00:00:00 2001 From: Kusakabe Si Date: Sat, 18 Dec 2021 11:23:36 +0000 Subject: [PATCH] Fix SetEndpointFromConnURL store url bug --- device/peer.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/device/peer.go b/device/peer.go index d089da3..41661ad 100644 --- a/device/peer.go +++ b/device/peer.go @@ -479,16 +479,17 @@ func (peer *Peer) SetEndpointFromConnURL(connurl string, af int, af_perfer int, fmt.Println("Internal: Set endpoint to " + connurl + " for NodeID:" + peer.ID.ToString()) } var err error - _, connurl, err = conn.LookupIP(connurl, af, af_perfer) + _, connIP, err := conn.LookupIP(connurl, af, af_perfer) if err != nil { return err } - if peer.GetEndpointDstStr() == connurl { - if peer.device.LogLevel.LogInternal { - fmt.Printf("Internal: Same as original endpoint:%v, skip for NodeID:%v\n", connurl, peer.ID.ToString()) - } + if peer.GetEndpointDstStr() == connIP { + //if peer.device.LogLevel.LogInternal { + // fmt.Printf("Internal: Same as original endpoint:%v, skip for NodeID:%v\n", connurl, peer.ID.ToString()) + //} + return nil } - endpoint, err := peer.device.net.bind.ParseEndpoint(connurl) + endpoint, err := peer.device.net.bind.ParseEndpoint(connIP) if err != nil { return err }