Rewrite the PSM (#2440)

* Rewrite the PSM

* Fix disconnecting from reserved peers

* Minor adjustements

* Address review

* Reputation changes adjustements

* More adjustements

* Adjust all reputations

* More fixes and adjustments

* Improve proof

* Remove the possible panic

* Make sure reputation reaches 0
This commit is contained in:
Pierre Krieger
2019-05-10 14:08:42 +02:00
committed by Gavin Wood
parent 18ca0170c3
commit 4aa44ab280
5 changed files with 766 additions and 572 deletions
@@ -159,7 +159,7 @@ impl<TMessage, TSubstream> Behaviour<TMessage, TSubstream> {
}
/// Returns the state of the peerset manager, for debugging purposes.
pub fn peerset_debug_info(&self) -> serde_json::Value {
pub fn peerset_debug_info(&mut self) -> serde_json::Value {
self.custom_protocols.peerset_debug_info()
}
}
@@ -357,7 +357,7 @@ impl<TMessage, TSubstream> CustomProto<TMessage, TSubstream> {
}
/// Returns the state of the peerset manager, for debugging purposes.
pub fn peerset_debug_info(&self) -> serde_json::Value {
pub fn peerset_debug_info(&mut self) -> serde_json::Value {
self.peerset.debug_info()
}