Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
invalidate cache for InterfaceListenAddresses on Listen
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Jun 4, 2019
1 parent a37c480 commit bf73c80
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions swarm_listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (s *Swarm) AddListenAddr(a ma.Multiaddr) error {
}
s.refs.Add(1)
s.listeners.m[list] = struct{}{}
s.listeners.cacheEOL = 0
s.listeners.Unlock()

maddr := list.Multiaddr()
Expand All @@ -69,6 +70,7 @@ func (s *Swarm) AddListenAddr(a ma.Multiaddr) error {
list.Close()
s.listeners.Lock()
delete(s.listeners.m, list)
s.listeners.cacheEOL = 0
s.listeners.Unlock()
s.refs.Done()
}()
Expand Down

0 comments on commit bf73c80

Please sign in to comment.