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
78477e41
Unverified
Commit
78477e41
authored
May 08, 2019
by
Péter Szilágyi
Committed by
GitHub
May 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19534 from karalabe/downloader-delay-fix
eth/downloader: fix header delays during chain dedup
parents
e770f624
85726fdb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
downloader.go
eth/downloader/downloader.go
+7
-0
No files found.
eth/downloader/downloader.go
View file @
78477e41
...
...
@@ -892,6 +892,7 @@ func (d *Downloader) fetchHeaders(p *peerConnection, from uint64, pivot uint64)
}
}
// Start pulling the header chain skeleton until all is done
ancestor
:=
from
getHeaders
(
from
)
for
{
...
...
@@ -962,6 +963,12 @@ func (d *Downloader) fetchHeaders(p *peerConnection, from uint64, pivot uint64)
head
=
full
}
}
// If the head is below the common ancestor, we're actually deduplicating
// already existing chain segments, so use the ancestor as the fake head.
// Otherwise we might end up delaying header deliveries pointlessly.
if
head
<
ancestor
{
head
=
ancestor
}
// If the head is way older than this batch, delay the last few headers
if
head
+
uint64
(
reorgProtThreshold
)
<
headers
[
n
-
1
]
.
Number
.
Uint64
()
{
delay
:=
reorgProtHeaderDelay
...
...
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