From 449b9a9d688eaf6a8628a3ae9fa1dd3496f99c71 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 18 Jul 2014 11:57:44 +0200 Subject: Check if version in known + fix --- peer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'peer.go') 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-- { -- cgit v1.2.3