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
8927f772
Unverified
Commit
8927f772
authored
Oct 31, 2019
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/devp2p, core/forkid: make forkid.Filter API uniform
parent
93422e9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
nodesetcmd.go
cmd/devp2p/nodesetcmd.go
+1
-1
forkid.go
core/forkid/forkid.go
+2
-2
No files found.
cmd/devp2p/nodesetcmd.go
View file @
8927f772
...
...
@@ -155,7 +155,7 @@ func minAgeFilter(args []string) (nodeFilter, error) {
}
func
ethFilter
(
args
[]
string
)
(
nodeFilter
,
error
)
{
var
filter
f
unc
(
forkid
.
ID
)
erro
r
var
filter
f
orkid
.
Filte
r
switch
args
[
0
]
{
case
"mainnet"
:
filter
=
forkid
.
NewStaticFilter
(
params
.
MainnetChainConfig
,
params
.
MainnetGenesisHash
)
...
...
core/forkid/forkid.go
View file @
8927f772
...
...
@@ -96,7 +96,7 @@ func NewFilter(chain *core.BlockChain) Filter {
}
// NewStaticFilter creates a filter at block zero.
func
NewStaticFilter
(
config
*
params
.
ChainConfig
,
genesis
common
.
Hash
)
func
(
id
ID
)
erro
r
{
func
NewStaticFilter
(
config
*
params
.
ChainConfig
,
genesis
common
.
Hash
)
Filte
r
{
head
:=
func
()
uint64
{
return
0
}
return
newFilter
(
config
,
genesis
,
head
)
}
...
...
@@ -104,7 +104,7 @@ func NewStaticFilter(config *params.ChainConfig, genesis common.Hash) func(id ID
// newFilter is the internal version of NewFilter, taking closures as its arguments
// instead of a chain. The reason is to allow testing it without having to simulate
// an entire blockchain.
func
newFilter
(
config
*
params
.
ChainConfig
,
genesis
common
.
Hash
,
headfn
func
()
uint64
)
func
(
id
ID
)
erro
r
{
func
newFilter
(
config
*
params
.
ChainConfig
,
genesis
common
.
Hash
,
headfn
func
()
uint64
)
Filte
r
{
// Calculate the all the valid fork hash and fork next combos
var
(
forks
=
gatherForks
(
config
)
...
...
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