good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Erigon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
a
Erigon
Commits
61a20cb5
Unverified
Commit
61a20cb5
authored
5 years ago
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
core: check error before accessing potentially nil block
parent
f088c650
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/genesis.go
+8
-2
8 additions, 2 deletions
core/genesis.go
with
8 additions
and
2 deletions
core/genesis.go
+
8
−
2
View file @
61a20cb5
...
...
@@ -164,7 +164,10 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
log
.
Info
(
"Writing custom genesis block"
)
}
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)
...
...
@@ -180,7 +183,10 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
return
genesis
.
Config
,
hash
,
&
GenesisMismatchError
{
stored
,
hash
}
}
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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment