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
fa53c5e0
Commit
fa53c5e0
authored
May 11, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: use count instead of peers, clearer
parent
ebbd8b07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
downloader.go
eth/downloader/downloader.go
+2
-2
peer.go
eth/downloader/peer.go
+2
-2
No files found.
eth/downloader/downloader.go
View file @
fa53c5e0
...
...
@@ -363,7 +363,7 @@ out:
}
}
// After removing bad peers make sure we actually have sufficient peer left to keep downloading
if
d
.
peers
.
Peers
()
==
0
{
if
d
.
peers
.
Len
()
==
0
{
d
.
queue
.
Reset
()
return
errNoPeers
}
...
...
@@ -400,7 +400,7 @@ out:
if
d
.
queue
.
InFlight
()
==
0
{
d
.
queue
.
Reset
()
return
fmt
.
Errorf
(
"%v peers available = %d. total peers = %d. hashes needed = %d"
,
errPeersUnavailable
,
len
(
idlePeers
),
d
.
peers
.
Peers
(),
d
.
queue
.
Pending
())
return
fmt
.
Errorf
(
"%v peers available = %d. total peers = %d. hashes needed = %d"
,
errPeersUnavailable
,
len
(
idlePeers
),
d
.
peers
.
Len
(),
d
.
queue
.
Pending
())
}
}
else
if
d
.
queue
.
InFlight
()
==
0
{
...
...
eth/downloader/peer.go
View file @
fa53c5e0
...
...
@@ -154,8 +154,8 @@ func (ps *peerSet) Peer(id string) *peer {
return
ps
.
peers
[
id
]
}
//
Peers
returns if the current number of peers in the set.
func
(
ps
*
peerSet
)
Peers
()
int
{
//
Len
returns if the current number of peers in the set.
func
(
ps
*
peerSet
)
Len
()
int
{
ps
.
lock
.
RLock
()
defer
ps
.
lock
.
RUnlock
()
...
...
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