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
306b5bcf
Commit
306b5bcf
authored
Jul 24, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed catching up code & peer handler
* Peers should be added no matter what * Catch up with _anyone_
parent
cbd71ef8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
peer.go
peer.go
+7
-14
No files found.
peer.go
View file @
306b5bcf
...
...
@@ -122,9 +122,6 @@ type Peer struct {
// Last received pong message
lastPong
int64
// Indicates whether a MsgGetPeersTy was requested of the peer
// this to prevent receiving false peers.
requestedPeerList
bool
host
[]
byte
port
uint16
...
...
@@ -463,9 +460,6 @@ func (p *Peer) HandleInbound() {
p
.
ethereum
.
TxPool
()
.
QueueTransaction
(
tx
)
}
case
ethwire
.
MsgGetPeersTy
:
// Flag this peer as a 'requested of new peers' this to
// prevent malicious peers being forced.
p
.
requestedPeerList
=
true
// Peer asked for list of connected peers
p
.
pushPeers
()
case
ethwire
.
MsgPeersTy
:
...
...
@@ -481,9 +475,6 @@ func (p *Peer) HandleInbound() {
// Connect to the list of peers
p
.
ethereum
.
ProcessPeerList
(
peers
)
// Mark unrequested again
p
.
requestedPeerList
=
false
case
ethwire
.
MsgGetChainTy
:
var
parent
*
ethchain
.
Block
// Length minus one since the very last element in the array is a count
...
...
@@ -695,11 +686,13 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) {
ethlogger
.
Infof
(
"Added peer (%s) %d / %d
\n
"
,
p
.
conn
.
RemoteAddr
(),
p
.
ethereum
.
Peers
()
.
Len
(),
p
.
ethereum
.
MaxPeers
)
// Catch up with the connected peer
if
!
p
.
ethereum
.
IsUpToDate
()
{
peerlogger
.
Debugln
(
"Already syncing up with a peer; sleeping"
)
time
.
Sleep
(
10
*
time
.
Second
)
}
/*
// Catch up with the connected peer
if !p.ethereum.IsUpToDate() {
peerlogger.Debugln("Already syncing up with a peer; sleeping")
time.Sleep(10 * time.Second)
}
*/
p
.
SyncWithPeerToLastKnown
()
peerlogger
.
Debugln
(
p
)
...
...
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