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
7ce3d064
Commit
7ce3d064
authored
Apr 24, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: removed update loop and synch channel
parent
405720b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
25 deletions
+0
-25
downloader.go
eth/downloader/downloader.go
+0
-25
No files found.
eth/downloader/downloader.go
View file @
7ce3d064
...
...
@@ -68,10 +68,8 @@ type Downloader struct {
// Channels
newPeerCh
chan
*
peer
syncCh
chan
syncPack
hashCh
chan
[]
common
.
Hash
blockCh
chan
blockPack
quit
chan
struct
{}
}
func
New
(
hasBlock
hashCheckFn
,
insertChain
chainInsertFn
)
*
Downloader
{
...
...
@@ -81,13 +79,9 @@ func New(hasBlock hashCheckFn, insertChain chainInsertFn) *Downloader {
hasBlock
:
hasBlock
,
insertChain
:
insertChain
,
newPeerCh
:
make
(
chan
*
peer
,
1
),
syncCh
:
make
(
chan
syncPack
,
1
),
hashCh
:
make
(
chan
[]
common
.
Hash
,
1
),
blockCh
:
make
(
chan
blockPack
,
1
),
quit
:
make
(
chan
struct
{}),
}
//go downloader.peerHandler()
go
downloader
.
update
()
return
downloader
}
...
...
@@ -121,25 +115,6 @@ func (d *Downloader) UnregisterPeer(id string) {
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
// 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
...
...
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