Skip to content

Commit

Permalink
use CompressDialError when applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
jchappelow committed Dec 9, 2024
1 parent 13ecdc1 commit 6a779a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions node/peers/peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (pm *PeerMan) maintainMinPeers(ctx context.Context) {
pid := peerInfo.ID
err := pm.h.Connect(ctx, peer.AddrInfo{ID: pid})
if err != nil {
pm.log.Warnf("Failed to connect to peer %s: %v", pid, err)
pm.log.Warnf("Failed to connect to peer %s: %v", pid, CompressDialError(err))
} else {
pm.log.Infof("Connected to peer %s", pid)
added++
Expand Down Expand Up @@ -198,7 +198,7 @@ func (pm *PeerMan) startPex(ctx context.Context) {
if pm.addPeerAddrs(peer) {
// TODO: connection manager, with limits
if err = pm.c.Connect(ctx, peer); err != nil {
pm.log.Warnf("Failed to connect to %s: %v", peer.ID, err)
pm.log.Warnf("Failed to connect to %s: %v", peer.ID, CompressDialError(err))
}
}
count++
Expand Down Expand Up @@ -557,7 +557,6 @@ func (pm *PeerMan) reconnectWithRetry(ctx context.Context, peerID peer.ID) {
cancel()
err = CompressDialError(err)
pm.log.Infof("Failed to reconnect to peer %s (trying again in %v): %v", peerID, delay, err)

} else {
cancel()
pm.log.Infof("Successfully reconnected to peer %s", peerID)
Expand Down

0 comments on commit 6a779a9

Please sign in to comment.