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
8485f7cc
Unverified
Commit
8485f7cc
authored
Jul 18, 2019
by
Péter Szilágyi
Committed by
GitHub
Jul 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19854 from karalabe/genesis-commit-check
core: check error before accessing potentially nil block
parents
f088c650
61a20cb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
genesis.go
core/genesis.go
+8
-2
No files found.
core/genesis.go
View file @
8485f7cc
...
@@ -164,7 +164,10 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
...
@@ -164,7 +164,10 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
log
.
Info
(
"Writing custom genesis block"
)
log
.
Info
(
"Writing custom genesis block"
)
}
}
block
,
err
:=
genesis
.
Commit
(
db
)
block
,
err
:=
genesis
.
Commit
(
db
)
return
genesis
.
Config
,
block
.
Hash
(),
err
if
err
!=
nil
{
return
genesis
.
Config
,
common
.
Hash
{},
err
}
return
genesis
.
Config
,
block
.
Hash
(),
nil
}
}
// We have the genesis block in database(perhaps in ancient database)
// We have the genesis block in database(perhaps in ancient database)
...
@@ -180,7 +183,10 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
...
@@ -180,7 +183,10 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
return
genesis
.
Config
,
hash
,
&
GenesisMismatchError
{
stored
,
hash
}
return
genesis
.
Config
,
hash
,
&
GenesisMismatchError
{
stored
,
hash
}
}
}
block
,
err
:=
genesis
.
Commit
(
db
)
block
,
err
:=
genesis
.
Commit
(
db
)
return
genesis
.
Config
,
block
.
Hash
(),
err
if
err
!=
nil
{
return
genesis
.
Config
,
hash
,
err
}
return
genesis
.
Config
,
block
.
Hash
(),
nil
}
}
// Check whether the genesis block is already written.
// Check whether the genesis block is already written.
...
...
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