mirror of https://github.com/status-im/go-waku.git
fix: close addrChan in the writer goroutine (#277)
This commit is contained in:
parent
a549337a42
commit
fb6d59ff33
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue