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
3fa76298
Commit
3fa76298
authored
Apr 10, 2019
by
ANOTHEL
Committed by
Péter Szilágyi
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p: remove useless parameter (#19433)
parent
e4cb7b80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
rlpx.go
p2p/rlpx.go
+2
-2
rlpx_test.go
p2p/rlpx_test.go
+1
-2
No files found.
p2p/rlpx.go
View file @
3fa76298
...
...
@@ -128,7 +128,7 @@ func (t *rlpx) doProtoHandshake(our *protoHandshake) (their *protoHandshake, err
// as the error so it can be tracked elsewhere.
werr
:=
make
(
chan
error
,
1
)
go
func
()
{
werr
<-
Send
(
t
.
rw
,
handshakeMsg
,
our
)
}()
if
their
,
err
=
readProtocolHandshake
(
t
.
rw
,
our
);
err
!=
nil
{
if
their
,
err
=
readProtocolHandshake
(
t
.
rw
);
err
!=
nil
{
<-
werr
// make sure the write terminates too
return
nil
,
err
}
...
...
@@ -141,7 +141,7 @@ func (t *rlpx) doProtoHandshake(our *protoHandshake) (their *protoHandshake, err
return
their
,
nil
}
func
readProtocolHandshake
(
rw
MsgReader
,
our
*
protoHandshake
)
(
*
protoHandshake
,
error
)
{
func
readProtocolHandshake
(
rw
MsgReader
)
(
*
protoHandshake
,
error
)
{
msg
,
err
:=
rw
.
ReadMsg
()
if
err
!=
nil
{
return
nil
,
err
...
...
p2p/rlpx_test.go
View file @
3fa76298
...
...
@@ -222,7 +222,6 @@ func TestProtocolHandshake(t *testing.T) {
}
func
TestProtocolHandshakeErrors
(
t
*
testing
.
T
)
{
our
:=
&
protoHandshake
{
Version
:
3
,
Caps
:
[]
Cap
{{
"foo"
,
2
},
{
"bar"
,
3
}},
Name
:
"quux"
}
tests
:=
[]
struct
{
code
uint64
msg
interface
{}
...
...
@@ -258,7 +257,7 @@ func TestProtocolHandshakeErrors(t *testing.T) {
for
i
,
test
:=
range
tests
{
p1
,
p2
:=
MsgPipe
()
go
Send
(
p1
,
test
.
code
,
test
.
msg
)
_
,
err
:=
readProtocolHandshake
(
p2
,
our
)
_
,
err
:=
readProtocolHandshake
(
p2
)
if
!
reflect
.
DeepEqual
(
err
,
test
.
err
)
{
t
.
Errorf
(
"test %d: error mismatch: got %q, want %q"
,
i
,
err
,
test
.
err
)
}
...
...
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