Skip to content

Commit d2afa36

Browse files
dbadoyHanWang233
authored andcommitted
p2p/discover: fix typos in comments (ethereum#25272)
1 parent a2a5899 commit d2afa36

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

p2p/discover/ntp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func sntpDrift(measurements int) (time.Duration, error) {
108108
// Calculate the drift based on an assumed answer time of RRT/2
109109
drifts = append(drifts, sent.Sub(t)+elapsed/2)
110110
}
111-
// Calculate average drif (drop two extremities to avoid outliers)
111+
// Calculate average drift (drop two extremities to avoid outliers)
112112
sort.Sort(durationSlice(drifts))
113113

114114
drift := time.Duration(0)

p2p/discover/table_util_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ func newPingRecorder() *pingRecorder {
134134
}
135135
}
136136

137-
// setRecord updates a node record. Future calls to ping and
138-
// requestENR will return this record.
137+
// updateRecord updates a node record. Future calls to ping and
138+
// RequestENR will return this record.
139139
func (t *pingRecorder) updateRecord(n *enode.Node) {
140140
t.mu.Lock()
141141
defer t.mu.Unlock()
@@ -162,7 +162,7 @@ func (t *pingRecorder) ping(n *enode.Node) (seq uint64, err error) {
162162
return seq, nil
163163
}
164164

165-
// requestENR simulates an ENR request.
165+
// RequestENR simulates an ENR request.
166166
func (t *pingRecorder) RequestENR(n *enode.Node) (*enode.Node, error) {
167167
t.mu.Lock()
168168
defer t.mu.Unlock()

p2p/discover/v4_udp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func (t *UDPv4) findnode(toid enode.ID, toaddr *net.UDPAddr, target v4wire.Pubke
334334
return nodes, err
335335
}
336336

337-
// RequestENR sends enrRequest to the given node and waits for a response.
337+
// RequestENR sends ENRRequest to the given node and waits for a response.
338338
func (t *UDPv4) RequestENR(n *enode.Node) (*enode.Node, error) {
339339
addr := &net.UDPAddr{IP: n.IP(), Port: n.UDP()}
340340
t.ensureBond(n.ID(), addr)

p2p/discover/v4_udp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ func TestUDPv4_EIP868(t *testing.T) {
490490
t.Fatalf("invalid record: %v", err)
491491
}
492492
if !reflect.DeepEqual(n, wantNode) {
493-
t.Fatalf("wrong node in enrResponse: %v", n)
493+
t.Fatalf("wrong node in ENRResponse: %v", n)
494494
}
495495
})
496496
}

p2p/discover/v4wire/v4wire.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ type (
8686
Rest []rlp.RawValue `rlp:"tail"`
8787
}
8888

89-
// enrRequest queries for the remote node's record.
89+
// ENRRequest queries for the remote node's record.
9090
ENRRequest struct {
9191
Expiration uint64
9292
// Ignore additional fields (for forward compatibility).
9393
Rest []rlp.RawValue `rlp:"tail"`
9494
}
9595

96-
// enrResponse is the reply to enrRequest.
96+
// ENRResponse is the reply to ENRRequest.
9797
ENRResponse struct {
98-
ReplyTok []byte // Hash of the enrRequest packet.
98+
ReplyTok []byte // Hash of the ENRRequest packet.
9999
Record enr.Record
100100
// Ignore additional fields (for forward compatibility).
101101
Rest []rlp.RawValue `rlp:"tail"`

p2p/discover/v5_udp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func (t *UDPv5) ping(n *enode.Node) (uint64, error) {
347347
}
348348
}
349349

350-
// requestENR requests n's record.
350+
// RequestENR requests n's record.
351351
func (t *UDPv5) RequestENR(n *enode.Node) (*enode.Node, error) {
352352
nodes, err := t.findnode(n, []uint{0})
353353
if err != nil {

p2p/discover/v5wire/encoding.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func (c *Codec) encodeWhoareyou(toID enode.ID, packet *Whoareyou) (Header, error
300300
return head, nil
301301
}
302302

303-
// encodeHandshakeMessage encodes the handshake message packet header.
303+
// encodeHandshakeHeader encodes the handshake message packet header.
304304
func (c *Codec) encodeHandshakeHeader(toID enode.ID, addr string, challenge *Whoareyou) (Header, *session, error) {
305305
// Ensure calling code sets challenge.node.
306306
if challenge.Node == nil {
@@ -337,7 +337,7 @@ func (c *Codec) encodeHandshakeHeader(toID enode.ID, addr string, challenge *Who
337337
return head, session, err
338338
}
339339

340-
// encodeAuthHeader creates the auth header on a request packet following WHOAREYOU.
340+
// makeHandshakeAuth creates the auth header on a request packet following WHOAREYOU.
341341
func (c *Codec) makeHandshakeAuth(toID enode.ID, addr string, challenge *Whoareyou) (*handshakeAuthData, *session, error) {
342342
auth := new(handshakeAuthData)
343343
auth.h.SrcID = c.localnode.ID()
@@ -379,7 +379,7 @@ func (c *Codec) makeHandshakeAuth(toID enode.ID, addr string, challenge *Whoarey
379379
return auth, sec, err
380380
}
381381

382-
// encodeMessage encodes an encrypted message packet.
382+
// encodeMessageHeader encodes an encrypted message packet.
383383
func (c *Codec) encodeMessageHeader(toID enode.ID, s *session) (Header, error) {
384384
head := c.makeHeader(toID, flagMessage, 0)
385385

@@ -632,7 +632,7 @@ func (h *StaticHeader) checkValid(packetLen int) error {
632632
return nil
633633
}
634634

635-
// headerMask returns a cipher for 'masking' / 'unmasking' packet headers.
635+
// mask returns a cipher for 'masking' / 'unmasking' packet headers.
636636
func (h *Header) mask(destID enode.ID) cipher.Stream {
637637
block, err := aes.NewCipher(destID[:16])
638638
if err != nil {

0 commit comments

Comments
 (0)