Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove penalty on duplicate Status message (#6377)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka committed Jun 18, 2020
1 parent 8e1f753 commit a2653e8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions client/network/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ mod rep {
pub const CLOGGED_PEER: Rep = Rep::new(-(1 << 12), "Clogged message queue");
/// Reputation change when a peer doesn't respond in time to our messages.
pub const TIMEOUT: Rep = Rep::new(-(1 << 10), "Request timeout");
/// Reputation change when a peer sends us a status message while we already received one.
pub const UNEXPECTED_STATUS: Rep = Rep::new(-(1 << 20), "Unexpected status message");
/// Reputation change when we are a light client and a peer is behind us.
pub const PEER_BEHIND_US_LIGHT: Rep = Rep::new(-(1 << 8), "Useless for a light peer");
/// Reputation change when a peer sends us any extrinsic.
Expand Down Expand Up @@ -979,12 +977,7 @@ impl<B: BlockT, H: ExHashT> Protocol<B, H> {
trace!(target: "sync", "New peer {} {:?}", who, status);
let _protocol_version = {
if self.context_data.peers.contains_key(&who) {
log!(
target: "sync",
if self.important_peers.contains(&who) { Level::Warn } else { Level::Debug },
"Unexpected status packet from {}", who
);
self.peerset_handle.report_peer(who, rep::UNEXPECTED_STATUS);
debug!(target: "sync", "Ignoring duplicate status packet from {}", who);
return CustomMessageOutcome::None;
}
if status.genesis_hash != self.genesis_hash {
Expand Down

0 comments on commit a2653e8

Please sign in to comment.