From a759ed554856a7ab3482f8915ab627dc58cde7a0 Mon Sep 17 00:00:00 2001 From: GoodDaisy <90915921+GoodDaisy@users.noreply.github.com> Date: Tue, 6 Feb 2024 03:29:42 +0800 Subject: [PATCH] chore: fix typos (#2694) --- p2p/net/reuseport/dialer.go | 2 +- p2p/net/swarm/swarm_dial.go | 4 ++-- p2p/net/upgrader/listener.go | 2 +- p2p/protocol/circuitv2/relay/relay.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/p2p/net/reuseport/dialer.go b/p2p/net/reuseport/dialer.go index 2efc02d39..ec3769a7a 100644 --- a/p2p/net/reuseport/dialer.go +++ b/p2p/net/reuseport/dialer.go @@ -33,7 +33,7 @@ func randAddr(addrs []*net.TCPAddr) *net.TCPAddr { // // In-order: // -// 1. If we're _explicitly_ listening on the prefered source address for the destination address +// 1. If we're _explicitly_ listening on the preferred source address for the destination address // (per the system's routes), we'll use that listener's port as the source port. // 2. If we're listening on one or more _unspecified_ addresses (zero address), we'll pick a source // port from one of these listener's. diff --git a/p2p/net/swarm/swarm_dial.go b/p2p/net/swarm/swarm_dial.go index 3fb15383a..f639ce16a 100644 --- a/p2p/net/swarm/swarm_dial.go +++ b/p2p/net/swarm/swarm_dial.go @@ -426,7 +426,7 @@ var quicDraft29DialMatcher = mafmt.And(mafmt.IP, mafmt.Base(ma.P_UDP), mafmt.Bas // filterKnownUndialables takes a list of multiaddrs, and removes those // that we definitely don't want to dial: addresses configured to be blocked, // IPv6 link-local addresses, addresses without a dial-capable transport, -// addresses that we know to be our own, and addresses with a better tranport +// addresses that we know to be our own, and addresses with a better transport // available. This is an optimization to avoid wasting time on dials that we // know are going to fail or for which we have a better alternative. func (s *Swarm) filterKnownUndialables(p peer.ID, addrs []ma.Multiaddr) (goodAddrs []ma.Multiaddr, addrErrs []TransportError) { @@ -546,7 +546,7 @@ func (s *Swarm) dialAddr(ctx context.Context, p peer.ID, addr ma.Multiaddr, updC } // We're recording any error as a failure here. - // Notably, this also applies to cancelations (i.e. if another dial attempt was faster). + // Notably, this also applies to cancellations (i.e. if another dial attempt was faster). // This is ok since the black hole detector uses a very low threshold (5%). s.bhd.RecordResult(addr, err == nil) diff --git a/p2p/net/upgrader/listener.go b/p2p/net/upgrader/listener.go index 0871d2f5a..8af2791b3 100644 --- a/p2p/net/upgrader/listener.go +++ b/p2p/net/upgrader/listener.go @@ -37,7 +37,7 @@ type listener struct { // Close closes the listener. func (l *listener) Close() error { - // Do this first to try to get any relevent errors. + // Do this first to try to get any relevant errors. err := l.Listener.Close() l.cancel() diff --git a/p2p/protocol/circuitv2/relay/relay.go b/p2p/protocol/circuitv2/relay/relay.go index b0e904698..0ad36168f 100644 --- a/p2p/protocol/circuitv2/relay/relay.go +++ b/p2p/protocol/circuitv2/relay/relay.go @@ -295,7 +295,7 @@ func (r *Relay) handleConnect(s network.Stream, msg *pbv2.HopMessage) pbv2.Statu destConns := r.conns[dest.ID] if destConns >= r.rc.MaxCircuits { r.mx.Unlock() - log.Debugf("refusing connection from %s to %s; too many connecitons to %s", src, dest.ID, dest.ID) + log.Debugf("refusing connection from %s to %s; too many connections to %s", src, dest.ID, dest.ID) fail(pbv2.Status_RESOURCE_LIMIT_EXCEEDED) return pbv2.Status_RESOURCE_LIMIT_EXCEEDED }