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
32c1ed8a
Unverified
Commit
32c1ed8a
authored
May 18, 2021
by
Shane Bammel
Committed by
GitHub
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/forkid: fix off-by-one bug (#22879)
* forkid: added failing test * forkid: fixed off-by-one bug
parent
b7a91663
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
forkid.go
core/forkid/forkid.go
+1
-1
forkid_test.go
core/forkid/forkid_test.go
+4
-0
No files found.
core/forkid/forkid.go
View file @
32c1ed8a
...
...
@@ -155,7 +155,7 @@ func newFilter(config *params.ChainConfig, genesis common.Hash, headfn func() ui
for
i
,
fork
:=
range
forks
{
// If our head is beyond this fork, continue to the next (we have a dummy
// fork of maxuint64 as the last item to always fail this check eventually).
if
head
>
fork
{
if
head
>
=
fork
{
continue
}
// Found the first unpassed fork block, check if our current state matches
...
...
core/forkid/forkid_test.go
View file @
32c1ed8a
...
...
@@ -163,6 +163,10 @@ func TestValidation(t *testing.T) {
// neither forks passed at neither nodes, they may mismatch, but we still connect for now.
{
7279999
,
ID
{
Hash
:
checksumToBytes
(
0xa00bc324
),
Next
:
math
.
MaxUint64
},
nil
},
// Local is mainnet exactly on Petersburg, remote announces Byzantium + knowledge about Petersburg. Remote
// is simply out of sync, accept.
{
7280000
,
ID
{
Hash
:
checksumToBytes
(
0xa00bc324
),
Next
:
7280000
},
nil
},
// Local is mainnet Petersburg, remote announces Byzantium + knowledge about Petersburg. Remote
// is simply out of sync, accept.
{
7987396
,
ID
{
Hash
:
checksumToBytes
(
0xa00bc324
),
Next
:
7280000
},
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