Skip to content

Commit

Permalink
remove stream destruction as it happens by default
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Aug 31, 2023
1 parent 1b46c0a commit 6497428
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/core/src/lib/stream_manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { PeerUpdate } from "@libp2p/interface";
import type { Stream } from "@libp2p/interface/connection";
import type { PeerId } from "@libp2p/interface/peer-id";
import { Peer } from "@libp2p/interface/peer-store";
import { Libp2p } from "@waku/interfaces";
import { selectConnection } from "@waku/utils/libp2p";
Expand All @@ -12,7 +11,9 @@ export class StreamManager {
public getConnections: Libp2p["getConnections"],
public addEventListener: Libp2p["addEventListener"],
private log: debug.Debugger
) {}
) {
addEventListener("peer:update", this.handlePeerUpdateStreamPool);
}

streamsPool: Map<string, Stream> = new Map();

Expand Down Expand Up @@ -74,11 +75,4 @@ export class StreamManager {
});
}
};

protected handlePeerDisconnectStreamPool = (
evt: CustomEvent<PeerId>
): void => {
const peerId = evt.detail;
this.streamsPool.delete(peerId.toString());
};
}

0 comments on commit 6497428

Please sign in to comment.