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
1027cb52
Unverified
Commit
1027cb52
authored
Mar 29, 2022
by
Péter Szilágyi
Committed by
GitHub
Mar 29, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24605 from karalabe/revert-setting-ttd
core: set ttd override on all chain variations
parents
b06e8c4a
b45d82e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
genesis.go
core/genesis.go
+15
-8
No files found.
core/genesis.go
View file @
1027cb52
...
...
@@ -282,6 +282,9 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override
if
overrideArrowGlacier
!=
nil
{
newcfg
.
ArrowGlacierBlock
=
overrideArrowGlacier
}
if
overrideTerminalTotalDifficulty
!=
nil
{
newcfg
.
TerminalTotalDifficulty
=
overrideTerminalTotalDifficulty
}
if
err
:=
newcfg
.
CheckConfigForkOrder
();
err
!=
nil
{
return
newcfg
,
common
.
Hash
{},
err
}
...
...
@@ -291,15 +294,19 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, override
rawdb
.
WriteChainConfig
(
db
,
stored
,
newcfg
)
return
newcfg
,
stored
,
nil
}
if
overrideTerminalTotalDifficulty
!=
nil
{
storedcfg
.
TerminalTotalDifficulty
=
overrideTerminalTotalDifficulty
}
// Special case: don't change the existing config of a non-mainnet chain if no new
// config is supplied. These chains would get AllProtocolChanges (and a compat error)
// if we just continued here.
// Special case: if a private network is being used (no genesis and also no
// mainnet hash in the database), we must not apply the `configOrDefault`
// chain config as that would be AllProtocolChanges (applying any new fork
// on top of an existing private network genesis block). In that case, only
// apply the overrides.
if
genesis
==
nil
&&
stored
!=
params
.
MainnetGenesisHash
{
return
storedcfg
,
stored
,
nil
newcfg
=
storedcfg
if
overrideArrowGlacier
!=
nil
{
newcfg
.
ArrowGlacierBlock
=
overrideArrowGlacier
}
if
overrideTerminalTotalDifficulty
!=
nil
{
newcfg
.
TerminalTotalDifficulty
=
overrideTerminalTotalDifficulty
}
}
// Check config compatibility and write the config. Compatibility errors
// are returned to the caller unless we're already at block zero.
...
...
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