Peer scoring updates (#1342)

* Prevent banned peers from interacting with the behaviour

* Update smallvec

* Add logs

* Correct log update
This commit is contained in:
Age Manning
2020-07-07 20:08:05 +10:00
committed by GitHub
parent ac2ce2ba6b
commit 025b262e01
2 changed files with 9 additions and 1 deletions

View File

@@ -798,6 +798,11 @@ impl<TSpec: EthSpec> NetworkBehaviour for Behaviour<TSpec> {
conn_id: ConnectionId,
event: <Self::ProtocolsHandler as ProtocolsHandler>::OutEvent,
) {
// All events from banned peers are rejected
if self.peer_manager.is_banned(&peer_id) {
return;
}
match event {
// Events comming from the handler, redirected to each behaviour
BehaviourHandlerOut::Delegate(delegate) => match *delegate {