good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
7ce3d064
Commit
7ce3d064
authored
Apr 24, 2015
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
eth/downloader: removed update loop and synch channel
parent
405720b2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
eth/downloader/downloader.go
+0
-25
0 additions, 25 deletions
eth/downloader/downloader.go
with
0 additions
and
25 deletions
eth/downloader/downloader.go
+
0
−
25
View file @
7ce3d064
...
@@ -68,10 +68,8 @@ type Downloader struct {
...
@@ -68,10 +68,8 @@ type Downloader struct {
// Channels
// Channels
newPeerCh
chan
*
peer
newPeerCh
chan
*
peer
syncCh
chan
syncPack
hashCh
chan
[]
common
.
Hash
hashCh
chan
[]
common
.
Hash
blockCh
chan
blockPack
blockCh
chan
blockPack
quit
chan
struct
{}
}
}
func
New
(
hasBlock
hashCheckFn
,
insertChain
chainInsertFn
)
*
Downloader
{
func
New
(
hasBlock
hashCheckFn
,
insertChain
chainInsertFn
)
*
Downloader
{
...
@@ -81,13 +79,9 @@ func New(hasBlock hashCheckFn, insertChain chainInsertFn) *Downloader {
...
@@ -81,13 +79,9 @@ func New(hasBlock hashCheckFn, insertChain chainInsertFn) *Downloader {
hasBlock
:
hasBlock
,
hasBlock
:
hasBlock
,
insertChain
:
insertChain
,
insertChain
:
insertChain
,
newPeerCh
:
make
(
chan
*
peer
,
1
),
newPeerCh
:
make
(
chan
*
peer
,
1
),
syncCh
:
make
(
chan
syncPack
,
1
),
hashCh
:
make
(
chan
[]
common
.
Hash
,
1
),
hashCh
:
make
(
chan
[]
common
.
Hash
,
1
),
blockCh
:
make
(
chan
blockPack
,
1
),
blockCh
:
make
(
chan
blockPack
,
1
),
quit
:
make
(
chan
struct
{}),
}
}
//go downloader.peerHandler()
go
downloader
.
update
()
return
downloader
return
downloader
}
}
...
@@ -121,25 +115,6 @@ func (d *Downloader) UnregisterPeer(id string) {
...
@@ -121,25 +115,6 @@ func (d *Downloader) UnregisterPeer(id string) {
delete
(
d
.
peers
,
id
)
delete
(
d
.
peers
,
id
)
}
}
func
(
d
*
Downloader
)
update
()
{
out
:
for
{
select
{
case
sync
:=
<-
d
.
syncCh
:
var
peer
*
peer
=
sync
.
peer
err
:=
d
.
getFromPeer
(
peer
,
sync
.
hash
,
sync
.
ignoreInitial
)
if
err
!=
nil
{
glog
.
V
(
logger
.
Detail
)
.
Infoln
(
err
)
break
}
d
.
process
(
peer
)
case
<-
d
.
quit
:
break
out
}
}
}
// SynchroniseWithPeer will select the peer and use it for synchronising. If an empty string is given
// SynchroniseWithPeer will select the peer and use it for synchronising. If an empty string is given
// it will use the best peer possible and synchronise if it's TD is higher than our own. If any of the
// it will use the best peer possible and synchronise if it's TD is higher than our own. If any of the
// checks fail an error will be returned. This method is synchronous
// checks fail an error will be returned. This method is synchronous
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment