Make sure we remove a peer on disconnect in gossip (#5104)

* Make sure we remove peers on disconnect in gossip state machine

* Clear up the code

* Add a comment
This commit is contained in:
Bastian Köcher
2020-03-02 18:20:04 +01:00
committed by GitHub
parent 9ab9134ea5
commit d3244b728a
3 changed files with 63 additions and 16 deletions
@@ -1167,8 +1167,7 @@ impl<B: BlockT> ChainSync<B> {
}
/// Restart the sync process.
fn restart<'a>(&'a mut self) -> impl Iterator<Item = Result<(PeerId, BlockRequest<B>), BadPeer>> + 'a
{
fn restart<'a>(&'a mut self) -> impl Iterator<Item = Result<(PeerId, BlockRequest<B>), BadPeer>> + 'a {
self.queue_blocks.clear();
self.blocks.clear();
let info = self.client.info();