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
7cf83cee
Commit
7cf83cee
authored
Apr 23, 2018
by
Domino Valdano
Committed by
Péter Szilágyi
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: fix for Issue #16539 (#16546)
parent
744428cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
downloader.go
eth/downloader/downloader.go
+11
-3
No files found.
eth/downloader/downloader.go
View file @
7cf83cee
...
...
@@ -306,7 +306,7 @@ func (d *Downloader) UnregisterPeer(id string) error {
d
.
cancelLock
.
RUnlock
()
if
master
{
d
.
C
ancel
()
d
.
c
ancel
()
}
return
nil
}
...
...
@@ -501,8 +501,10 @@ func (d *Downloader) spawnSync(fetchers []func() error) error {
return
err
}
// Cancel cancels all of the operations and resets the queue.
func
(
d
*
Downloader
)
Cancel
()
{
// cancel aborts all of the operations and resets the queue. However, cancel does
// not wait for the running download goroutines to finish. This method should be
// used when cancelling the downloads from inside the downloader.
func
(
d
*
Downloader
)
cancel
()
{
// Close the current cancel channel
d
.
cancelLock
.
Lock
()
if
d
.
cancelCh
!=
nil
{
...
...
@@ -514,6 +516,12 @@ func (d *Downloader) Cancel() {
}
}
d
.
cancelLock
.
Unlock
()
}
// Cancel aborts all of the operations and waits for all download goroutines to
// finish before returning.
func
(
d
*
Downloader
)
Cancel
()
{
d
.
cancel
()
d
.
cancelWg
.
Wait
()
}
...
...
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