From 00734e2f8dbe0f36df0f134c613d9d3bf366c597 Mon Sep 17 00:00:00 2001 From: Gheis Mohammadi Date: Fri, 12 Jan 2024 02:47:06 +0800 Subject: [PATCH] closing stream removes it from stream manager as well, so it doesn't need to remove it on caller function (#4606) --- p2p/stream/protocols/sync/protocol.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/p2p/stream/protocols/sync/protocol.go b/p2p/stream/protocols/sync/protocol.go index 0cb48bfff..b4e84592a 100644 --- a/p2p/stream/protocols/sync/protocol.go +++ b/p2p/stream/protocols/sync/protocol.go @@ -271,8 +271,6 @@ func (p *Protocol) RemoveStream(stID sttypes.StreamID) { if exist && st != nil { //TODO: log this incident with reason st.Close() - // stream manager removes this stream from the list and triggers discovery if number of streams are not enough - p.sm.RemoveStream(stID) //TODO: double check to see if this part is needed p.logger.Info(). Str("stream ID", string(stID)). Msg("stream removed") @@ -290,8 +288,6 @@ func (p *Protocol) StreamFailed(stID sttypes.StreamID, reason string) { Msg("stream failed") if st.FailedTimes() >= MaxStreamFailures { st.Close() - // stream manager removes this stream from the list and triggers discovery if number of streams are not enough - p.sm.RemoveStream(stID) //TODO: double check to see if this part is needed p.logger.Warn(). Str("stream ID", string(st.ID())). Msg("stream removed")