good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
open
bor
Commits
14bef9a2
Unverified
Commit
14bef9a2
authored
6 years ago
by
Péter Szilágyi
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
core: fix unnecessary ancestor lookup after a fast sync (#17825)
parent
d3a773c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/chain_indexer.go
+5
-5
5 additions, 5 deletions
core/chain_indexer.go
with
5 additions
and
5 deletions
core/chain_indexer.go
+
5
−
5
View file @
14bef9a2
...
...
@@ -219,13 +219,13 @@ func (c *ChainIndexer) eventLoop(currentHeader *types.Header, events chan ChainE
}
header
:=
ev
.
Block
.
Header
()
if
header
.
ParentHash
!=
prevHash
{
// Reorg to the common ancestor (might not exist in light sync mode, skip reorg then)
// Reorg to the common ancestor
if needed
(might not exist in light sync mode, skip reorg then)
// TODO(karalabe, zsfelfoldi): This seems a bit brittle, can we detect this case explicitly?
// TODO(karalabe): This operation is expensive and might block, causing the event system to
// potentially also lock up. We need to do with on a different thread somehow.
if
h
:=
rawdb
.
FindCommonAncestor
(
c
.
chainDb
,
prevHeader
,
header
);
h
!=
nil
{
c
.
newHead
(
h
.
Number
.
Uint64
(),
true
)
if
rawdb
.
ReadCanonicalHash
(
c
.
chainDb
,
prevHeader
.
Number
.
Uint64
())
!=
prevHash
{
if
h
:=
rawdb
.
FindCommonAncestor
(
c
.
chainDb
,
prevHeader
,
header
);
h
!=
nil
{
c
.
newHead
(
h
.
Number
.
Uint64
(),
true
)
}
}
}
c
.
newHead
(
header
.
Number
.
Uint64
(),
false
)
...
...
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