From 8d290f611034cd937a609b9d6ac0fa346edebdf7 Mon Sep 17 00:00:00 2001
From: Arkadiy Paronyan <arkady.paronyan@gmail.com>
Date: Thu, 7 Mar 2019 22:12:57 +0100
Subject: [PATCH] Don't mark peers sending expired messages as useless (#1944)

---
 substrate/core/network/src/consensus_gossip.rs | 7 -------
 substrate/core/network/src/protocol.rs         | 1 -
 2 files changed, 8 deletions(-)

diff --git a/substrate/core/network/src/consensus_gossip.rs b/substrate/core/network/src/consensus_gossip.rs
index d32003050a0..dbd8836b21a 100644
--- a/substrate/core/network/src/consensus_gossip.rs
+++ b/substrate/core/network/src/consensus_gossip.rs
@@ -303,7 +303,6 @@ impl<B: BlockT> ConsensusGossip<B> {
 		protocol: &mut Context<B>,
 		who: NodeIndex,
 		message: ConsensusMessage,
-		is_syncing: bool,
 	) -> Option<(B::Hash, ConsensusMessage)> {
 		let message_hash = HashFor::<B>::hash(&message.data[..]);
 
@@ -332,12 +331,6 @@ impl<B: BlockT> ConsensusGossip<B> {
 				},
 				Some(ValidationResult::Expired) => {
 					trace!(target:"gossip", "Ignored expired message from {}", who);
-					if !is_syncing {
-						protocol.report_peer(
-							who,
-							Severity::Useless(format!("Sent expired consensus message")),
-						);
-					}
 					return None;
 				}
 				None => {
diff --git a/substrate/core/network/src/protocol.rs b/substrate/core/network/src/protocol.rs
index c191c2d32f0..9636d1bb14f 100644
--- a/substrate/core/network/src/protocol.rs
+++ b/substrate/core/network/src/protocol.rs
@@ -484,7 +484,6 @@ impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Protocol<B, S, H> {
 					&mut ProtocolContext::new(&mut self.context_data, &self.network_chan),
 					who,
 					msg,
-					self.sync.status().is_major_syncing(),
 				);
 			}
 			other => self.specialization.on_message(
-- 
GitLab