Skip to content

Commit

Permalink
closing stream removes it from stream manager as well, so it doesn't …
Browse files Browse the repository at this point in the history
…need to remove it on caller function (#4606)
  • Loading branch information
GheisMohammadi authored Jan 11, 2024
1 parent f576910 commit 00734e2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions p2p/stream/protocols/sync/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit 00734e2

Please sign in to comment.