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
fd3e1061
Commit
fd3e1061
authored
Feb 13, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p: handle disconnect before protocol handshake
parent
cf754b94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
peer.go
p2p/peer.go
+7
-0
No files found.
p2p/peer.go
View file @
fd3e1061
...
...
@@ -255,6 +255,13 @@ func readProtocolHandshake(p *Peer, rw MsgReadWriter) error {
if
err
!=
nil
{
return
err
}
if
msg
.
Code
==
discMsg
{
// disconnect before protocol handshake is valid according to the
// spec and we send it ourself if Server.addPeer fails.
var
reason
DiscReason
rlp
.
Decode
(
msg
.
Payload
,
&
reason
)
return
discRequestedError
(
reason
)
}
if
msg
.
Code
!=
handshakeMsg
{
return
newPeerError
(
errProtocolBreach
,
"expected handshake, got %x"
,
msg
.
Code
)
}
...
...
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