@@ -847,6 +847,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
847
847
pm .lendingpool .AddRemotes (txs )
848
848
}
849
849
case msg .Code == VoteMsg :
850
+ // VoteMsg arrived, make sure we have a valid and fresh chain to handle them
851
+ if atomic .LoadUint32 (& pm .acceptTxs ) == 0 {
852
+ break
853
+ }
854
+
850
855
var vote types.Vote
851
856
if err := msg .Decode (& vote ); err != nil {
852
857
return errResp (ErrDecode , "msg %v: %v" , msg , err )
@@ -864,6 +869,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
864
869
}
865
870
866
871
case msg .Code == TimeoutMsg :
872
+ // TimeoutMsg arrived, make sure we have a valid and fresh chain to handle them
873
+ if atomic .LoadUint32 (& pm .acceptTxs ) == 0 {
874
+ break
875
+ }
876
+
867
877
var timeout types.Timeout
868
878
if err := msg .Decode (& timeout ); err != nil {
869
879
return errResp (ErrDecode , "msg %v: %v" , msg , err )
@@ -883,6 +893,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
883
893
}
884
894
885
895
case msg .Code == SyncInfoMsg :
896
+ // SyncInfoMsg arrived, make sure we have a valid and fresh chain to handle them
897
+ if atomic .LoadUint32 (& pm .acceptTxs ) == 0 {
898
+ break
899
+ }
900
+
886
901
var syncInfo types.SyncInfo
887
902
if err := msg .Decode (& syncInfo ); err != nil {
888
903
return errResp (ErrDecode , "msg %v: %v" , msg , err )
0 commit comments