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
78b70d79
Commit
78b70d79
authored
Apr 01, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/utils: fix geth startup with empty database
parent
fb578f45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
flags.go
cmd/utils/flags.go
+13
-14
No files found.
cmd/utils/flags.go
View file @
78b70d79
...
...
@@ -772,23 +772,22 @@ func MustMakeChainConfig(ctx *cli.Context) *core.ChainConfig {
)
defer
db
.
Close
()
chainConfig
,
err
:=
core
.
GetChainConfig
(
db
,
genesis
.
Hash
())
if
err
!=
nil
{
if
err
!=
core
.
ChainConfigNotFoundErr
{
if
genesis
!=
nil
{
// Exsting genesis block, use stored config if available.
storedConfig
,
err
:=
core
.
GetChainConfig
(
db
,
genesis
.
Hash
())
if
err
==
nil
{
return
storedConfig
}
else
if
err
!=
core
.
ChainConfigNotFoundErr
{
Fatalf
(
"Could not make chain configuration: %v"
,
err
)
}
var
homesteadBlockNo
*
big
.
Int
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
homesteadBlockNo
=
params
.
TestNetHomesteadBlock
}
else
{
homesteadBlockNo
=
params
.
MainNetHomesteadBlock
}
chainConfig
=
&
core
.
ChainConfig
{
HomesteadBlock
:
homesteadBlockNo
,
}
}
return
chainConfig
var
homesteadBlockNo
*
big
.
Int
if
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
{
homesteadBlockNo
=
params
.
TestNetHomesteadBlock
}
else
{
homesteadBlockNo
=
params
.
MainNetHomesteadBlock
}
return
&
core
.
ChainConfig
{
HomesteadBlock
:
homesteadBlockNo
}
}
// MakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails.
...
...
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