Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
firelizzard18 committed Sep 8, 2023
1 parent f1a6a72 commit a625cd9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/api/v3/p2p/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ func (d *dialer) Dial(ctx context.Context, addr multiaddr.Multiaddr) (stream mes
// BadDial notifies the dialer that a transport error was encountered while
// processing the stream.
func (d *dialer) BadDial(ctx context.Context, addr multiaddr.Multiaddr, s message.Stream, err error) bool {
ss := s.(*stream)
ss, ok := s.(*stream)
if !ok {
return false
}
slog.InfoCtx(ctx, "Bad dial", "peer", ss.peer, "address", addr, "error", err)
d.tracker.markBad(ctx, ss.peer, addr)
return true
}
Expand Down Expand Up @@ -273,9 +277,6 @@ func (d *dialer) dial(ctx context.Context, peer peer.ID, service *api.ServiceAdd
return stream
}

// Mark the peer bad
d.tracker.markBad(ctx, peer, addr)

// Log the error
var timeoutError interface{ Timeout() bool }
switch {
Expand Down

0 comments on commit a625cd9

Please sign in to comment.