fix: close addrChan in the writer goroutine (#277)

This commit is contained in:
Steven Normore 2022-08-01 20:16:52 -04:00 committed by GitHub
parent a549337a42
commit fb6d59ff33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -212,6 +212,7 @@ func (w *WakuNode) checkForAddressChanges() {
for { for {
select { select {
case <-w.quit: case <-w.quit:
close(w.addrChan)
return return
case <-first: case <-first:
w.log.Info("listening", logging.MultiAddrs("multiaddr", addrs...)) w.log.Info("listening", logging.MultiAddrs("multiaddr", addrs...))
@ -323,7 +324,6 @@ func (w *WakuNode) Stop() {
defer w.cancel() defer w.cancel()
close(w.quit) close(w.quit)
close(w.addrChan)
w.bcaster.Close() w.bcaster.Close()