Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Error when closing stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Djadih committed Mar 1, 2024
1 parent 19453a1 commit ae24f43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions p2p/peerManager/peerManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,16 @@ func (pm *BasicPeerManager) prunePeerConnection(peerID p2p.PeerID) error {
if ok {
log.Global.WithField("peerID", peerID).Debug("Pruned connection with peer")
severStream(peerID, stream)
return nil
}
return errStreamNotFound
}

func severStream(key interface{}, value interface{}) {
stream := value.(network.Stream)
stream.Close()
err := stream.Close()
if err != nil {
log.Global.WithField("err", err).Error("Failed to close stream")
}
}

func (pm *BasicPeerManager) SetP2PBackend(host quaiprotocol.QuaiP2PNode) {
Expand Down

0 comments on commit ae24f43

Please sign in to comment.