Unverified Commit bb1d6e7d authored by Andronik Ordian's avatar Andronik Ordian Committed by GitHub
Browse files

network-bridge: downgrade log level of benefit rep change (#3068)

* network-bridge: downgrade log level of benefit rep change

* remove it as we log it at higher level
parent 732a3804
Pipeline #139009 passed with stages
in 30 minutes and 18 seconds
......@@ -433,10 +433,12 @@ where
}
Ok(FromOverseer::Communication { msg }) => match msg {
NetworkBridgeMessage::ReportPeer(peer, rep) => {
tracing::debug!(
target: LOG_TARGET,
action = "ReportPeer"
);
if !rep.is_benefit() {
tracing::debug!(
target: LOG_TARGET,
action = "ReportPeer"
);
}
network_service.report_peer(peer, rep).await?
}
NetworkBridgeMessage::DisconnectPeer(peer, peer_set) => {
......
......@@ -55,6 +55,17 @@ impl UnifiedReputationChange {
}
}
/// Whether the reputation change is for good behavior.
pub const fn is_benefit(&self) -> bool {
match self {
Self::BenefitMajorFirst(_) |
Self::BenefitMajor(_) |
Self::BenefitMinorFirst(_) |
Self::BenefitMinor(_) => true,
_ => false,
}
}
/// Convert into a base reputation as used with substrate.
pub const fn into_base_rep(self) -> ReputationChange {
ReputationChange::new(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment