mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-05 22:33:10 +00:00
added missing Close call on the AddrBook member of GossipSubRouter (#568)
This commit is contained in:
parent
093f13ce16
commit
e508d8643d
@ -3,6 +3,7 @@ package pubsub
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"sort"
|
||||
"time"
|
||||
@ -543,6 +544,13 @@ func (gs *GossipSubRouter) manageAddrBook() {
|
||||
for {
|
||||
select {
|
||||
case <-gs.p.ctx.Done():
|
||||
cabCloser, ok := gs.cab.(io.Closer)
|
||||
if ok {
|
||||
errClose := cabCloser.Close()
|
||||
if errClose != nil {
|
||||
log.Warnf("failed to close addr book: %v", errClose)
|
||||
}
|
||||
}
|
||||
return
|
||||
case ev := <-sub.Out():
|
||||
switch ev := ev.(type) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user