Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ export class GossipSub extends TypedEventEmitter<GossipsubEvents> implements Pub
// TODO make this behavior more robust
// This behavior is different than for inbound streams
// If an outbound stream already exists, don't create a new stream
if (this.streamsOutbound.has(id)) {
if (this.streamsOutbound.get(id)?.rawStream?.status === "open") {
return
}

Expand Down Expand Up @@ -1834,7 +1834,7 @@ export class GossipSub extends TypedEventEmitter<GossipsubEvents> implements Pub
private async directConnect (): Promise<void> {
const toconnect: string[] = []
this.direct.forEach((id) => {
if (!this.streamsOutbound.has(id)) {
if (!this.streamsOutbound.get(id)?.rawStream?.status === "open") {
toconnect.push(id)
}
})
Expand Down