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
3088c122
Commit
3088c122
authored
Oct 23, 2018
by
Wenbiao Zheng
Committed by
Felix Lange
Oct 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: fix comment typos (#17956)
parent
88b41a9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
downloader.go
eth/downloader/downloader.go
+3
-3
queue.go
eth/downloader/queue.go
+3
-3
No files found.
eth/downloader/downloader.go
View file @
3088c122
...
@@ -1246,7 +1246,7 @@ func (d *Downloader) processHeaders(origin uint64, pivot uint64, td *big.Int) er
...
@@ -1246,7 +1246,7 @@ func (d *Downloader) processHeaders(origin uint64, pivot uint64, td *big.Int) er
}
}
// If no headers were retrieved at all, the peer violated its TD promise that it had a
// If no headers were retrieved at all, the peer violated its TD promise that it had a
// better chain compared to ours. The only exception is if its promised blocks were
// better chain compared to ours. The only exception is if its promised blocks were
// already imported by other means (e.g. fecher):
// already imported by other means (e.g. fe
t
cher):
//
//
// R <remote peer>, L <local node>: Both at block 10
// R <remote peer>, L <local node>: Both at block 10
// R: Mine block 11, and propagate it to L
// R: Mine block 11, and propagate it to L
...
@@ -1415,7 +1415,7 @@ func (d *Downloader) processFastSyncContent(latest *types.Header) error {
...
@@ -1415,7 +1415,7 @@ func (d *Downloader) processFastSyncContent(latest *types.Header) error {
defer
stateSync
.
Cancel
()
defer
stateSync
.
Cancel
()
go
func
()
{
go
func
()
{
if
err
:=
stateSync
.
Wait
();
err
!=
nil
&&
err
!=
errCancelStateFetch
{
if
err
:=
stateSync
.
Wait
();
err
!=
nil
&&
err
!=
errCancelStateFetch
{
d
.
queue
.
Close
()
// wake up
Wait
Results
d
.
queue
.
Close
()
// wake up Results
}
}
}()
}()
// Figure out the ideal pivot block. Note, that this goalpost may move if the
// Figure out the ideal pivot block. Note, that this goalpost may move if the
...
@@ -1473,7 +1473,7 @@ func (d *Downloader) processFastSyncContent(latest *types.Header) error {
...
@@ -1473,7 +1473,7 @@ func (d *Downloader) processFastSyncContent(latest *types.Header) error {
defer
stateSync
.
Cancel
()
defer
stateSync
.
Cancel
()
go
func
()
{
go
func
()
{
if
err
:=
stateSync
.
Wait
();
err
!=
nil
&&
err
!=
errCancelStateFetch
{
if
err
:=
stateSync
.
Wait
();
err
!=
nil
&&
err
!=
errCancelStateFetch
{
d
.
queue
.
Close
()
// wake up
Wait
Results
d
.
queue
.
Close
()
// wake up Results
}
}
}()
}()
oldPivot
=
P
oldPivot
=
P
...
...
eth/downloader/queue.go
View file @
3088c122
...
@@ -143,7 +143,7 @@ func (q *queue) Reset() {
...
@@ -143,7 +143,7 @@ func (q *queue) Reset() {
q
.
resultOffset
=
0
q
.
resultOffset
=
0
}
}
// Close marks the end of the sync, unblocking
Wait
Results.
// Close marks the end of the sync, unblocking Results.
// It may be called even if the queue is already closed.
// It may be called even if the queue is already closed.
func
(
q
*
queue
)
Close
()
{
func
(
q
*
queue
)
Close
()
{
q
.
lock
.
Lock
()
q
.
lock
.
Lock
()
...
@@ -545,7 +545,7 @@ func (q *queue) reserveHeaders(p *peerConnection, count int, taskPool map[common
...
@@ -545,7 +545,7 @@ func (q *queue) reserveHeaders(p *peerConnection, count int, taskPool map[common
taskQueue
.
Push
(
header
,
-
int64
(
header
.
Number
.
Uint64
()))
taskQueue
.
Push
(
header
,
-
int64
(
header
.
Number
.
Uint64
()))
}
}
if
progress
{
if
progress
{
// Wake
Wait
Results, resultCache was modified
// Wake Results, resultCache was modified
q
.
active
.
Signal
()
q
.
active
.
Signal
()
}
}
// Assemble and return the block download request
// Assemble and return the block download request
...
@@ -857,7 +857,7 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQ
...
@@ -857,7 +857,7 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQ
taskQueue
.
Push
(
header
,
-
int64
(
header
.
Number
.
Uint64
()))
taskQueue
.
Push
(
header
,
-
int64
(
header
.
Number
.
Uint64
()))
}
}
}
}
// Wake up
Wait
Results
// Wake up Results
if
accepted
>
0
{
if
accepted
>
0
{
q
.
active
.
Signal
()
q
.
active
.
Signal
()
}
}
...
...
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