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
492d5454
Commit
492d5454
authored
Jul 09, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: drop peer if advertised TD but won't delvier
parent
a2333bcb
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
99 deletions
+44
-99
downloader.go
eth/downloader/downloader.go
+8
-0
downloader_test.go
eth/downloader/downloader_test.go
+36
-99
No files found.
eth/downloader/downloader.go
View file @
492d5454
...
@@ -804,6 +804,8 @@ func (d *Downloader) fetchHashes(p *peer, from uint64) error {
...
@@ -804,6 +804,8 @@ func (d *Downloader) fetchHashes(p *peer, from uint64) error {
}
}
// Start pulling hashes, until all are exhausted
// Start pulling hashes, until all are exhausted
getHashes
(
from
)
getHashes
(
from
)
gotHashes
:=
false
for
{
for
{
select
{
select
{
case
<-
d
.
cancelCh
:
case
<-
d
.
cancelCh
:
...
@@ -825,8 +827,14 @@ func (d *Downloader) fetchHashes(p *peer, from uint64) error {
...
@@ -825,8 +827,14 @@ func (d *Downloader) fetchHashes(p *peer, from uint64) error {
case
d
.
processCh
<-
false
:
case
d
.
processCh
<-
false
:
case
<-
d
.
cancelCh
:
case
<-
d
.
cancelCh
:
}
}
// Error out if no hashes were retrieved at all
if
!
gotHashes
{
return
errStallingPeer
}
return
nil
return
nil
}
}
gotHashes
=
true
// Otherwise insert all the new hashes, aborting in case of junk
// Otherwise insert all the new hashes, aborting in case of junk
glog
.
V
(
logger
.
Detail
)
.
Infof
(
"%v: inserting %d hashes from #%d"
,
p
,
len
(
hashPack
.
hashes
),
from
)
glog
.
V
(
logger
.
Detail
)
.
Infof
(
"%v: inserting %d hashes from #%d"
,
p
,
len
(
hashPack
.
hashes
),
from
)
...
...
eth/downloader/downloader_test.go
View file @
492d5454
This diff is collapsed.
Click to expand it.
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