Decrease the peer reputation on invalid block requests (#8260)

* Decrease the peer reputation on invalid block requests

This pr changes the block request handler to decrease the reputation of
peers when they send the same request multiple times or they send us an
invalid block request.

* Review feedback

* Change log target

* Remove unused code
This commit is contained in:
Bastian Köcher
2021-03-09 14:43:19 +01:00
committed by GitHub
parent 0dc9750026
commit 85f32e8813
5 changed files with 130 additions and 26 deletions
+5 -1
View File
@@ -727,7 +727,11 @@ pub trait TestNetFactory: Sized {
let protocol_id = ProtocolId::from("test-protocol-name");
let block_request_protocol_config = {
let (handler, protocol_config) = BlockRequestHandler::new(&protocol_id, client.clone());
let (handler, protocol_config) = BlockRequestHandler::new(
&protocol_id,
client.clone(),
50,
);
self.spawn_task(handler.run().boxed());
protocol_config
};