From 30d7958a6f353824936556ba087c4d5dd84cd976 Mon Sep 17 00:00:00 2001 From: Liam Lai Date: Sat, 15 Oct 2022 01:05:38 +0800 Subject: [PATCH] skip process message whenever synchronising --- eth/handler.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eth/handler.go b/eth/handler.go index f9f75ef259..a84d46d455 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -849,8 +849,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { pm.lendingpool.AddRemotes(txs) } case msg.Code == VoteMsg: - // VoteMsg arrived, make sure we have a valid and fresh chain to handle them - if atomic.LoadUint32(&pm.acceptTxs) == 0 { + if pm.downloader.Synchronising() { break } @@ -868,8 +867,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { } case msg.Code == TimeoutMsg: - // TimeoutMsg arrived, make sure we have a valid and fresh chain to handle them - if atomic.LoadUint32(&pm.acceptTxs) == 0 { + if pm.downloader.Synchronising() { break } @@ -888,8 +886,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { } case msg.Code == SyncInfoMsg: - // SyncInfoMsg arrived, make sure we have a valid and fresh chain to handle them - if atomic.LoadUint32(&pm.acceptTxs) == 0 { + if pm.downloader.Synchronising() { break }