Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
  • Loading branch information
sandreim committed Aug 28, 2023
1 parent 69ab461 commit 0ffbd54
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions polkadot/node/subsystem-util/src/reputation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl ReputationAggregator {
rep: UnifiedReputationChange,
) {
if rep.cost_or_benefit() < 0 {
gum::debug!(target: LOG_TARGET, peer = ?peer_id, ?rep, "Modify reputation");
gum::debug!(target: LOG_TARGET, peer = ?peer_id, ?rep, "Reduce reputation");
}

if (self.send_immediately_if)(rep) {
Expand All @@ -103,8 +103,7 @@ impl ReputationAggregator {

fn add(&mut self, peer_id: PeerId, rep: UnifiedReputationChange) {
let cost = rep.cost_or_benefit();
self
.by_peer
self.by_peer
.get_or_insert(HashMap::new())
.entry(peer_id)
.and_modify(|v| *v = v.saturating_add(cost))
Expand Down

0 comments on commit 0ffbd54

Please sign in to comment.