mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 22:03:07 +00:00
don't respawn writer if we fail to open a stream; declare it a peer error
This commit is contained in:
parent
b289ec5017
commit
e9e5a9913f
12
comm.go
12
comm.go
@ -13,7 +13,6 @@ import (
|
||||
"github.com/libp2p/go-msgio/protoio"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
ms "github.com/multiformats/go-multistream"
|
||||
)
|
||||
|
||||
// get the initial RPC containing all of our subscriptions to send to new peers
|
||||
@ -106,14 +105,11 @@ func (p *PubSub) handleNewPeer(ctx context.Context, pid peer.ID, outgoing <-chan
|
||||
if err != nil {
|
||||
log.Debug("opening new stream to peer: ", err, pid)
|
||||
|
||||
if err == ms.ErrNotSupported {
|
||||
select {
|
||||
case p.newPeerError <- pid:
|
||||
case <-ctx.Done():
|
||||
}
|
||||
} else {
|
||||
p.notifyPeerDead(pid)
|
||||
select {
|
||||
case p.newPeerError <- pid:
|
||||
case <-ctx.Done():
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user