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
9e8cc00b
Unverified
Commit
9e8cc00b
authored
Nov 19, 2019
by
Felix Lange
Committed by
GitHub
Nov 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p: remove unused code (#20325)
parent
ac5e28ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
23 deletions
+1
-23
rlpx.go
p2p/rlpx.go
+0
-10
server.go
p2p/server.go
+1
-2
util.go
p2p/util.go
+0
-11
No files found.
p2p/rlpx.go
View file @
9e8cc00b
...
...
@@ -422,16 +422,6 @@ func (h *encHandshake) makeAuthResp() (msg *authRespV4, err error) {
return
msg
,
nil
}
func
(
msg
*
authMsgV4
)
sealPlain
(
h
*
encHandshake
)
([]
byte
,
error
)
{
buf
:=
make
([]
byte
,
authMsgLen
)
n
:=
copy
(
buf
,
msg
.
Signature
[
:
])
n
+=
copy
(
buf
[
n
:
],
crypto
.
Keccak256
(
exportPubkey
(
&
h
.
randomPrivKey
.
PublicKey
)))
n
+=
copy
(
buf
[
n
:
],
msg
.
InitiatorPubkey
[
:
])
n
+=
copy
(
buf
[
n
:
],
msg
.
Nonce
[
:
])
buf
[
n
]
=
0
// token-flag
return
ecies
.
Encrypt
(
rand
.
Reader
,
h
.
remote
,
buf
,
nil
,
nil
)
}
func
(
msg
*
authMsgV4
)
decodePlain
(
input
[]
byte
)
{
n
:=
copy
(
msg
.
Signature
[
:
],
input
)
n
+=
shaLen
// skip sha3(initiator-ephemeral-pubk)
...
...
p2p/server.go
View file @
9e8cc00b
...
...
@@ -199,7 +199,6 @@ type Server struct {
checkpointAddPeer
chan
*
conn
// State of run loop and listenLoop.
lastLookup
time
.
Time
inboundHistory
expHeap
}
...
...
@@ -410,7 +409,7 @@ type sharedUDPConn struct {
func
(
s
*
sharedUDPConn
)
ReadFromUDP
(
b
[]
byte
)
(
n
int
,
addr
*
net
.
UDPAddr
,
err
error
)
{
packet
,
ok
:=
<-
s
.
unhandled
if
!
ok
{
return
0
,
nil
,
errors
.
New
(
"
C
onnection was closed"
)
return
0
,
nil
,
errors
.
New
(
"
c
onnection was closed"
)
}
l
:=
len
(
packet
.
Data
)
if
l
>
len
(
b
)
{
...
...
p2p/util.go
View file @
9e8cc00b
...
...
@@ -40,17 +40,6 @@ func (h *expHeap) add(item string, exp time.Time) {
heap
.
Push
(
h
,
expItem
{
item
,
exp
})
}
// remove removes an item.
func
(
h
*
expHeap
)
remove
(
item
string
)
bool
{
for
i
,
v
:=
range
*
h
{
if
v
.
item
==
item
{
heap
.
Remove
(
h
,
i
)
return
true
}
}
return
false
}
// contains checks whether an item is present.
func
(
h
expHeap
)
contains
(
item
string
)
bool
{
for
_
,
v
:=
range
h
{
...
...
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