libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
321 stars 185 forks source link

Cannot find remote peer if pubsub is initialized after connection established #357

Closed huiscool closed 3 years ago

huiscool commented 4 years ago

Hi, I initialize a pubsub with a pre-connected host, and I find that pubsub cannot find the remote peer on a established connection, even if the remote peer also has a pubsub. The network.notifiee only tells which new peer is incoming, but it doesn't tell the connected peers. So how can I deal with this? Thanks!

vyzo commented 4 years ago

Yes indeed, this is the case and a problem. What we could do is scan the active connections on initialization and check whether already connected peers support one of our pubsub protocols.

Wondertan commented 3 years ago

Is this closed by https://github.com/libp2p/go-libp2p-pubsub/pull/393?

huiscool commented 3 years ago

Yep, I think #393 will resolve this problem.