Skip to content

Commit

Permalink
identify: fix bug in observed address handling (#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan4th authored and MarcoPolo committed Jun 13, 2024
1 parent 48b809d commit 1a1f7b7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions p2p/protocol/identify/obsaddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ func (o *ObservedAddrManager) removeConn(conn connMultiaddrs) {
o.mu.Lock()
defer o.mu.Unlock()

observedTWAddr, ok := o.connObservedTWAddrs[conn]
if !ok {
return
}
delete(o.connObservedTWAddrs, conn)

// normalize before obtaining the thinWaist so that we are always dealing
// with the normalized form of the address
localTW, err := thinWaistForm(o.normalize(conn.LocalMultiaddr()))
Expand All @@ -467,11 +473,6 @@ func (o *ObservedAddrManager) removeConn(conn connMultiaddrs) {
delete(o.localAddrs, string(localTW.Addr.Bytes()))
}

observedTWAddr, ok := o.connObservedTWAddrs[conn]
if !ok {
return
}
delete(o.connObservedTWAddrs, conn)
observer, err := getObserver(conn.RemoteMultiaddr())
if err != nil {
return
Expand Down

0 comments on commit 1a1f7b7

Please sign in to comment.