Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
b3fc9574
Unverified
Commit
b3fc9574
authored
Jul 10, 2022
by
Seungbae.yu
Committed by
GitHub
Jul 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/discover: fix typos in comments (#25272)
parent
d8395154
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
14 deletions
+14
-14
ntp.go
p2p/discover/ntp.go
+1
-1
table_util_test.go
p2p/discover/table_util_test.go
+3
-3
v4_udp.go
p2p/discover/v4_udp.go
+1
-1
v4_udp_test.go
p2p/discover/v4_udp_test.go
+1
-1
v4wire.go
p2p/discover/v4wire/v4wire.go
+3
-3
v5_udp.go
p2p/discover/v5_udp.go
+1
-1
encoding.go
p2p/discover/v5wire/encoding.go
+4
-4
No files found.
p2p/discover/ntp.go
View file @
b3fc9574
...
...
@@ -108,7 +108,7 @@ func sntpDrift(measurements int) (time.Duration, error) {
// Calculate the drift based on an assumed answer time of RRT/2
drifts
=
append
(
drifts
,
sent
.
Sub
(
t
)
+
elapsed
/
2
)
}
// Calculate average drif (drop two extremities to avoid outliers)
// Calculate average drif
t
(drop two extremities to avoid outliers)
sort
.
Sort
(
durationSlice
(
drifts
))
drift
:=
time
.
Duration
(
0
)
...
...
p2p/discover/table_util_test.go
View file @
b3fc9574
...
...
@@ -134,8 +134,8 @@ func newPingRecorder() *pingRecorder {
}
}
//
set
Record updates a node record. Future calls to ping and
//
r
equestENR will return this record.
//
update
Record updates a node record. Future calls to ping and
//
R
equestENR will return this record.
func
(
t
*
pingRecorder
)
updateRecord
(
n
*
enode
.
Node
)
{
t
.
mu
.
Lock
()
defer
t
.
mu
.
Unlock
()
...
...
@@ -162,7 +162,7 @@ func (t *pingRecorder) ping(n *enode.Node) (seq uint64, err error) {
return
seq
,
nil
}
//
r
equestENR simulates an ENR request.
//
R
equestENR simulates an ENR request.
func
(
t
*
pingRecorder
)
RequestENR
(
n
*
enode
.
Node
)
(
*
enode
.
Node
,
error
)
{
t
.
mu
.
Lock
()
defer
t
.
mu
.
Unlock
()
...
...
p2p/discover/v4_udp.go
View file @
b3fc9574
...
...
@@ -334,7 +334,7 @@ func (t *UDPv4) findnode(toid enode.ID, toaddr *net.UDPAddr, target v4wire.Pubke
return
nodes
,
err
}
// RequestENR sends
enr
Request to the given node and waits for a response.
// RequestENR sends
ENR
Request to the given node and waits for a response.
func
(
t
*
UDPv4
)
RequestENR
(
n
*
enode
.
Node
)
(
*
enode
.
Node
,
error
)
{
addr
:=
&
net
.
UDPAddr
{
IP
:
n
.
IP
(),
Port
:
n
.
UDP
()}
t
.
ensureBond
(
n
.
ID
(),
addr
)
...
...
p2p/discover/v4_udp_test.go
View file @
b3fc9574
...
...
@@ -490,7 +490,7 @@ func TestUDPv4_EIP868(t *testing.T) {
t
.
Fatalf
(
"invalid record: %v"
,
err
)
}
if
!
reflect
.
DeepEqual
(
n
,
wantNode
)
{
t
.
Fatalf
(
"wrong node in
enr
Response: %v"
,
n
)
t
.
Fatalf
(
"wrong node in
ENR
Response: %v"
,
n
)
}
})
}
...
...
p2p/discover/v4wire/v4wire.go
View file @
b3fc9574
...
...
@@ -86,16 +86,16 @@ type (
Rest
[]
rlp
.
RawValue
`rlp:"tail"`
}
//
enr
Request queries for the remote node's record.
//
ENR
Request queries for the remote node's record.
ENRRequest
struct
{
Expiration
uint64
// Ignore additional fields (for forward compatibility).
Rest
[]
rlp
.
RawValue
`rlp:"tail"`
}
//
enrResponse is the reply to enr
Request.
//
ENRResponse is the reply to ENR
Request.
ENRResponse
struct
{
ReplyTok
[]
byte
// Hash of the
enr
Request packet.
ReplyTok
[]
byte
// Hash of the
ENR
Request packet.
Record
enr
.
Record
// Ignore additional fields (for forward compatibility).
Rest
[]
rlp
.
RawValue
`rlp:"tail"`
...
...
p2p/discover/v5_udp.go
View file @
b3fc9574
...
...
@@ -347,7 +347,7 @@ func (t *UDPv5) ping(n *enode.Node) (uint64, error) {
}
}
//
r
equestENR requests n's record.
//
R
equestENR requests n's record.
func
(
t
*
UDPv5
)
RequestENR
(
n
*
enode
.
Node
)
(
*
enode
.
Node
,
error
)
{
nodes
,
err
:=
t
.
findnode
(
n
,
[]
uint
{
0
})
if
err
!=
nil
{
...
...
p2p/discover/v5wire/encoding.go
View file @
b3fc9574
...
...
@@ -300,7 +300,7 @@ func (c *Codec) encodeWhoareyou(toID enode.ID, packet *Whoareyou) (Header, error
return
head
,
nil
}
// encodeHandshake
Message
encodes the handshake message packet header.
// encodeHandshake
Header
encodes the handshake message packet header.
func
(
c
*
Codec
)
encodeHandshakeHeader
(
toID
enode
.
ID
,
addr
string
,
challenge
*
Whoareyou
)
(
Header
,
*
session
,
error
)
{
// Ensure calling code sets challenge.node.
if
challenge
.
Node
==
nil
{
...
...
@@ -337,7 +337,7 @@ func (c *Codec) encodeHandshakeHeader(toID enode.ID, addr string, challenge *Who
return
head
,
session
,
err
}
//
encodeAuthHeader
creates the auth header on a request packet following WHOAREYOU.
//
makeHandshakeAuth
creates the auth header on a request packet following WHOAREYOU.
func
(
c
*
Codec
)
makeHandshakeAuth
(
toID
enode
.
ID
,
addr
string
,
challenge
*
Whoareyou
)
(
*
handshakeAuthData
,
*
session
,
error
)
{
auth
:=
new
(
handshakeAuthData
)
auth
.
h
.
SrcID
=
c
.
localnode
.
ID
()
...
...
@@ -379,7 +379,7 @@ func (c *Codec) makeHandshakeAuth(toID enode.ID, addr string, challenge *Whoarey
return
auth
,
sec
,
err
}
// encodeMessage encodes an encrypted message packet.
// encodeMessage
Header
encodes an encrypted message packet.
func
(
c
*
Codec
)
encodeMessageHeader
(
toID
enode
.
ID
,
s
*
session
)
(
Header
,
error
)
{
head
:=
c
.
makeHeader
(
toID
,
flagMessage
,
0
)
...
...
@@ -632,7 +632,7 @@ func (h *StaticHeader) checkValid(packetLen int) error {
return
nil
}
//
headerM
ask returns a cipher for 'masking' / 'unmasking' packet headers.
//
m
ask returns a cipher for 'masking' / 'unmasking' packet headers.
func
(
h
*
Header
)
mask
(
destID
enode
.
ID
)
cipher
.
Stream
{
block
,
err
:=
aes
.
NewCipher
(
destID
[
:
16
])
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment