mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 12:53:09 +00:00
fix: treat peers already connected to the host before pubsub is initialized as valid potential pubsub peers
This commit is contained in:
parent
4336d5ae71
commit
aa4f9dac2f
@ -32,3 +32,12 @@ func (p *PubSubNotif) Listen(n network.Network, _ ma.Multiaddr) {
|
||||
|
||||
func (p *PubSubNotif) ListenClose(n network.Network, _ ma.Multiaddr) {
|
||||
}
|
||||
|
||||
func (p *PubSubNotif) Initialize() {
|
||||
for _, pr := range p.host.Network().Peers() {
|
||||
select {
|
||||
case p.newPeers <- pr:
|
||||
case <-p.ctx.Done():
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user