diff --git a/pkg/network/tcp_peer.go b/pkg/network/tcp_peer.go index 62ceb417d..8c56f9d45 100644 --- a/pkg/network/tcp_peer.go +++ b/pkg/network/tcp_peer.go @@ -207,11 +207,7 @@ func (p *TCPPeer) StartProtocol() { // Try to sync in headers and block with the peer if his block height is higher then ours. if p.LastBlockIndex() > p.server.chain.BlockHeight() { err = p.server.requestBlocks(p) - } - if err == nil { - timer.Reset(p.server.ProtoTickInterval) - } - if p.server.chain.HeaderHeight() >= p.LastBlockIndex() { + } else if p.server.chain.HeaderHeight() >= p.LastBlockIndex() { block, errGetBlock := p.server.chain.GetBlock(p.server.chain.CurrentBlockHash()) if errGetBlock != nil { err = errGetBlock @@ -223,6 +219,9 @@ func (p *TCPPeer) StartProtocol() { } } } + if err == nil { + timer.Reset(p.server.ProtoTickInterval) + } case <-pingTimer.C: if p.GetPingSent() > defaultPingLimit { err = errors.New("ping/pong timeout")