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
449b9a9d
Commit
449b9a9d
authored
Jul 18, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if version in known + fix
parent
28a146d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
ethereum.go
ethereum.go
+1
-1
peer.go
peer.go
+5
-2
No files found.
ethereum.go
View file @
449b9a9d
...
@@ -160,7 +160,7 @@ func (s *Ethereum) IsUpToDate() bool {
...
@@ -160,7 +160,7 @@ func (s *Ethereum) IsUpToDate() bool {
upToDate
:=
true
upToDate
:=
true
eachPeer
(
s
.
peers
,
func
(
peer
*
Peer
,
e
*
list
.
Element
)
{
eachPeer
(
s
.
peers
,
func
(
peer
*
Peer
,
e
*
list
.
Element
)
{
if
atomic
.
LoadInt32
(
&
peer
.
connected
)
==
1
{
if
atomic
.
LoadInt32
(
&
peer
.
connected
)
==
1
{
if
peer
.
catchingUp
==
true
{
if
peer
.
catchingUp
==
true
&&
peer
.
versionKnown
{
upToDate
=
false
upToDate
=
false
}
}
}
}
...
...
peer.go
View file @
449b9a9d
...
@@ -328,6 +328,7 @@ func (p *Peer) HandleInbound() {
...
@@ -328,6 +328,7 @@ func (p *Peer) HandleInbound() {
for
_
,
msg
:=
range
msgs
{
for
_
,
msg
:=
range
msgs
{
peerlogger
.
DebugDetailf
(
"(%v) => %v %v
\n
"
,
p
.
conn
.
RemoteAddr
(),
msg
.
Type
,
msg
.
Data
)
peerlogger
.
DebugDetailf
(
"(%v) => %v %v
\n
"
,
p
.
conn
.
RemoteAddr
(),
msg
.
Type
,
msg
.
Data
)
nextMsg
:
switch
msg
.
Type
{
switch
msg
.
Type
{
case
ethwire
.
MsgHandshakeTy
:
case
ethwire
.
MsgHandshakeTy
:
// Version message
// Version message
...
@@ -373,6 +374,7 @@ func (p *Peer) HandleInbound() {
...
@@ -373,6 +374,7 @@ func (p *Peer) HandleInbound() {
p
.
diverted
=
false
p
.
diverted
=
false
if
!
p
.
ethereum
.
StateManager
()
.
BlockChain
()
.
FindCanonicalChainFromMsg
(
msg
,
block
.
PrevHash
)
{
if
!
p
.
ethereum
.
StateManager
()
.
BlockChain
()
.
FindCanonicalChainFromMsg
(
msg
,
block
.
PrevHash
)
{
p
.
SyncWithPeerToLastKnown
()
p
.
SyncWithPeerToLastKnown
()
break
nextMsg
}
}
break
break
}
}
...
@@ -385,10 +387,11 @@ func (p *Peer) HandleInbound() {
...
@@ -385,10 +387,11 @@ func (p *Peer) HandleInbound() {
p
.
blocksRequested
=
p
.
blocksRequested
*
2
p
.
blocksRequested
=
p
.
blocksRequested
*
2
peerlogger
.
Infof
(
"No common ancestor found, requesting %d more blocks.
\n
"
,
p
.
blocksRequested
)
peerlogger
.
Infof
(
"No common ancestor found, requesting %d more blocks.
\n
"
,
p
.
blocksRequested
)
p
.
catchingUp
=
false
p
.
FindCommonParentBlock
()
p
.
FindCommonParentBlock
()
break
break
nextMsg
}
}
p
.
catchingUp
=
false
}
}
for
i
:=
msg
.
Data
.
Len
()
-
1
;
i
>=
0
;
i
--
{
for
i
:=
msg
.
Data
.
Len
()
-
1
;
i
>=
0
;
i
--
{
...
...
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