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
81c3dc72
Commit
81c3dc72
authored
Dec 21, 2018
by
Wenbiao Zheng
Committed by
Felix Lange
Dec 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: progress in stateSync not used anymore (#17998)
parent
ca7c13ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
statesync.go
eth/downloader/statesync.go
+4
-7
No files found.
eth/downloader/statesync.go
View file @
81c3dc72
...
@@ -152,7 +152,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
...
@@ -152,7 +152,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
finished
=
append
(
finished
,
req
)
finished
=
append
(
finished
,
req
)
delete
(
active
,
pack
.
PeerId
())
delete
(
active
,
pack
.
PeerId
())
// Handle dropped peer connections:
// Handle dropped peer connections:
case
p
:=
<-
peerDrop
:
case
p
:=
<-
peerDrop
:
// Skip if no request is currently pending
// Skip if no request is currently pending
req
:=
active
[
p
.
id
]
req
:=
active
[
p
.
id
]
...
@@ -398,9 +398,8 @@ func (s *stateSync) fillTasks(n int, req *stateReq) {
...
@@ -398,9 +398,8 @@ func (s *stateSync) fillTasks(n int, req *stateReq) {
// process iterates over a batch of delivered state data, injecting each item
// process iterates over a batch of delivered state data, injecting each item
// into a running state sync, re-queuing any items that were requested but not
// into a running state sync, re-queuing any items that were requested but not
// delivered.
// delivered. Returns whether the peer actually managed to deliver anything of
// Returns whether the peer actually managed to deliver anything of value,
// value, and any error that occurred.
// and any error that occurred
func
(
s
*
stateSync
)
process
(
req
*
stateReq
)
(
int
,
error
)
{
func
(
s
*
stateSync
)
process
(
req
*
stateReq
)
(
int
,
error
)
{
// Collect processing stats and update progress if valid data was received
// Collect processing stats and update progress if valid data was received
duplicate
,
unexpected
,
successful
:=
0
,
0
,
0
duplicate
,
unexpected
,
successful
:=
0
,
0
,
0
...
@@ -412,14 +411,12 @@ func (s *stateSync) process(req *stateReq) (int, error) {
...
@@ -412,14 +411,12 @@ func (s *stateSync) process(req *stateReq) (int, error) {
}(
time
.
Now
())
}(
time
.
Now
())
// Iterate over all the delivered data and inject one-by-one into the trie
// Iterate over all the delivered data and inject one-by-one into the trie
progress
:=
false
for
_
,
blob
:=
range
req
.
response
{
for
_
,
blob
:=
range
req
.
response
{
prog
,
hash
,
err
:=
s
.
processNodeData
(
blob
)
_
,
hash
,
err
:=
s
.
processNodeData
(
blob
)
switch
err
{
switch
err
{
case
nil
:
case
nil
:
s
.
numUncommitted
++
s
.
numUncommitted
++
s
.
bytesUncommitted
+=
len
(
blob
)
s
.
bytesUncommitted
+=
len
(
blob
)
progress
=
progress
||
prog
successful
++
successful
++
case
trie
.
ErrNotRequested
:
case
trie
.
ErrNotRequested
:
unexpected
++
unexpected
++
...
...
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