aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-18 18:03:19 +0800
committerobscuren <geffobscura@gmail.com>2014-07-18 18:03:19 +0800
commit65650a5c66d03b64c24ec3247ac1c7cdac25b74a (patch)
treeaa193485a347249e5ce747a0329cd6f6d9fbc178
parentdb8170def31e03ecb7086dd257d7c8fce084313f (diff)
parent449b9a9d688eaf6a8628a3ae9fa1dd3496f99c71 (diff)
downloadgo-tangerine-65650a5c66d03b64c24ec3247ac1c7cdac25b74a.tar
go-tangerine-65650a5c66d03b64c24ec3247ac1c7cdac25b74a.tar.gz
go-tangerine-65650a5c66d03b64c24ec3247ac1c7cdac25b74a.tar.bz2
go-tangerine-65650a5c66d03b64c24ec3247ac1c7cdac25b74a.tar.lz
go-tangerine-65650a5c66d03b64c24ec3247ac1c7cdac25b74a.tar.xz
go-tangerine-65650a5c66d03b64c24ec3247ac1c7cdac25b74a.tar.zst
go-tangerine-65650a5c66d03b64c24ec3247ac1c7cdac25b74a.zip
Merge branch 'develop' into guiminer
-rw-r--r--ethereum.go2
-rw-r--r--peer.go7
2 files changed, 6 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go
index f43d37be2..18c1f8a23 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -160,7 +160,7 @@ func (s *Ethereum) IsUpToDate() bool {
upToDate := true
eachPeer(s.peers, func(peer *Peer, e *list.Element) {
if atomic.LoadInt32(&peer.connected) == 1 {
- if peer.catchingUp == true {
+ if peer.catchingUp == true && peer.versionKnown {
upToDate = false
}
}
diff --git a/peer.go b/peer.go
index 1e354ca6d..a900a3192 100644
--- a/peer.go
+++ b/peer.go
@@ -328,6 +328,7 @@ func (p *Peer) HandleInbound() {
for _, msg := range msgs {
peerlogger.DebugDetailf("(%v) => %v %v\n", p.conn.RemoteAddr(), msg.Type, msg.Data)
+ nextMsg:
switch msg.Type {
case ethwire.MsgHandshakeTy:
// Version message
@@ -373,6 +374,7 @@ func (p *Peer) HandleInbound() {
p.diverted = false
if !p.ethereum.StateManager().BlockChain().FindCanonicalChainFromMsg(msg, block.PrevHash) {
p.SyncWithPeerToLastKnown()
+ break nextMsg
}
break
}
@@ -385,10 +387,11 @@ func (p *Peer) HandleInbound() {
p.blocksRequested = p.blocksRequested * 2
peerlogger.Infof("No common ancestor found, requesting %d more blocks.\n", p.blocksRequested)
- p.catchingUp = false
p.FindCommonParentBlock()
- break
+ break nextMsg
}
+
+ p.catchingUp = false
}
for i := msg.Data.Len() - 1; i >= 0; i-- {