Reputation changes requires reason (#4277)

This commit is contained in:
Arkadiy Paronyan
2019-12-03 11:33:33 +01:00
committed by Gavin Wood
parent 5edc4350b4
commit 5ec0923285
14 changed files with 233 additions and 156 deletions
@@ -940,7 +940,10 @@ where
// a different chain, or a node that doesn't speak the same protocol(s). We
// decrease the node's reputation, hence lowering the chances we try this node
// again in the short term.
self.peerset.report_peer(source.clone(), i32::min_value());
self.peerset.report_peer(
source.clone(),
peerset::ReputationChange::new(i32::min_value(), "Protocol error")
);
self.disconnect_peer_inner(&source, Some(Duration::from_secs(5)));
}
}