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
35e8308b
Commit
35e8308b
authored
Feb 27, 2017
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth, les: shorten genesis block mismatch error message
parent
fc97c7a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
peer.go
eth/peer.go
+1
-1
protocol_test.go
eth/protocol_test.go
+1
-1
peer.go
les/peer.go
+1
-1
No files found.
eth/peer.go
View file @
35e8308b
...
...
@@ -280,7 +280,7 @@ func (p *peer) readStatus(network int, status *statusData, genesis common.Hash)
return
errResp
(
ErrDecode
,
"msg %v: %v"
,
msg
,
err
)
}
if
status
.
GenesisBlock
!=
genesis
{
return
errResp
(
ErrGenesisBlockMismatch
,
"%x (!= %x)"
,
status
.
GenesisBlock
,
genesis
)
return
errResp
(
ErrGenesisBlockMismatch
,
"%x (!= %x)"
,
status
.
GenesisBlock
[
:
8
],
genesis
[
:
8
]
)
}
if
int
(
status
.
NetworkId
)
!=
network
{
return
errResp
(
ErrNetworkIdMismatch
,
"%d (!= %d)"
,
status
.
NetworkId
,
network
)
...
...
eth/protocol_test.go
View file @
35e8308b
...
...
@@ -63,7 +63,7 @@ func testStatusMsgErrors(t *testing.T, protocol int) {
},
{
code
:
StatusMsg
,
data
:
statusData
{
uint32
(
protocol
),
NetworkId
,
td
,
currentBlock
,
common
.
Hash
{
3
}},
wantError
:
errResp
(
ErrGenesisBlockMismatch
,
"0300000000000000
000000000000000000000000000000000000000000000000 (!= %x)"
,
genesis
),
wantError
:
errResp
(
ErrGenesisBlockMismatch
,
"0300000000000000
(!= %x)"
,
genesis
[
:
8
]
),
},
}
...
...
les/peer.go
View file @
35e8308b
...
...
@@ -367,7 +367,7 @@ func (p *peer) Handshake(td *big.Int, head common.Hash, headNum uint64, genesis
}
if
rGenesis
!=
genesis
{
return
errResp
(
ErrGenesisBlockMismatch
,
"%x (!= %x)"
,
rGenesis
,
genesis
)
return
errResp
(
ErrGenesisBlockMismatch
,
"%x (!= %x)"
,
rGenesis
[
:
8
],
genesis
[
:
8
]
)
}
if
int
(
rNetwork
)
!=
p
.
network
{
return
errResp
(
ErrNetworkIdMismatch
,
"%d (!= %d)"
,
rNetwork
,
p
.
network
)
...
...
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