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
d3beff7e
Commit
d3beff7e
authored
Oct 10, 2017
by
Péter Szilágyi
Committed by
Felix Lange
Oct 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
consensus/clique: add fork hash enforcement (#15236)
parent
40a3856a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
clique.go
consensus/clique/clique.go
+5
-0
snapshot_test.go
consensus/clique/snapshot_test.go
+1
-1
No files found.
consensus/clique/clique.go
View file @
d3beff7e
...
...
@@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/consensus/misc"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
...
...
@@ -313,6 +314,10 @@ func (c *Clique) verifyHeader(chain consensus.ChainReader, header *types.Header,
return
errInvalidDifficulty
}
}
// If all checks passed, validate any special fields for hard forks
if
err
:=
misc
.
VerifyForkHashes
(
chain
.
Config
(),
header
,
false
);
err
!=
nil
{
return
err
}
// All basic checks passed, verify cascading fields
return
c
.
verifyCascadingFields
(
chain
,
header
,
parents
)
}
...
...
consensus/clique/snapshot_test.go
View file @
d3beff7e
...
...
@@ -74,7 +74,7 @@ type testerChainReader struct {
db
ethdb
.
Database
}
func
(
r
*
testerChainReader
)
Config
()
*
params
.
ChainConfig
{
panic
(
"not supported"
)
}
func
(
r
*
testerChainReader
)
Config
()
*
params
.
ChainConfig
{
return
params
.
AllProtocolChanges
}
func
(
r
*
testerChainReader
)
CurrentHeader
()
*
types
.
Header
{
panic
(
"not supported"
)
}
func
(
r
*
testerChainReader
)
GetHeader
(
common
.
Hash
,
uint64
)
*
types
.
Header
{
panic
(
"not supported"
)
}
func
(
r
*
testerChainReader
)
GetBlock
(
common
.
Hash
,
uint64
)
*
types
.
Block
{
panic
(
"not supported"
)
}
...
...
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