Skip to content

Commit

Permalink
Drop connection to peer if the stream is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsporn committed Sep 14, 2022
1 parent f6ab41b commit e263216
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/protocol/gossip/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,12 @@ func (s *Service) deregisterProtocol(peerID peer.ID) error {
return fmt.Errorf("unable to cleanly reset stream to %s: %w", peerID, err)
}

// Drop connection to peer since we no longer have a protocol stream to it
conn := proto.Stream.Conn()
if conn != nil {
return conn.Close()
}

return nil
}

Expand Down

0 comments on commit e263216

Please sign in to comment.