Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(header/p2p): add trivial retrying for trustedPeer requested #1647

Merged
merged 10 commits into from
Jan 31, 2023
Prev Previous commit
Next Next commit
use error is
  • Loading branch information
Wondertan committed Jan 31, 2023
commit aa496dfe627ebf84be822e0194665988e3744254
3 changes: 2 additions & 1 deletion libs/header/p2p/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package p2p
import (
"bytes"
"context"
"errors"
"fmt"
"math/rand"
"sort"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (ex *Exchange[H]) Start(context.Context) error {
// and just need any peers in the peerTracker asap
go func(p peer.ID) {
err := ex.host.Connect(ex.ctx, peer.AddrInfo{ID: p})
if err != nil && err != context.Canceled && err != context.DeadlineExceeded {
if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, context.DeadlineExceeded) {
log.Debugw("err connecting to a bootstrap peer", "err", err, "peer", p)
}
}(p)
Expand Down