*: Update to libp2p v0.21.1 (#6559)

* *Cargo.toml: Update versions

* client/network/src/discovery: Adjust to Kademlia  API changes

* client/network: Adjust to one_shot.rs changes

* client/network/discovery: Log address list on trace level

* client/network/discovery: Ignore RoutablePeer and PendingRoutablePeer

* Commit Cargo.lock

* Finish update

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
Max Inden
2020-07-08 16:00:30 +02:00
committed by GitHub
parent 8ca05879e8
commit faa72caf91
18 changed files with 171 additions and 128 deletions
+8 -2
View File
@@ -29,7 +29,13 @@ use libp2p::swarm::{NetworkBehaviourAction, NetworkBehaviourEventProcess, PollPa
use log::debug;
use sp_consensus::{BlockOrigin, import_queue::{IncomingBlock, Origin}};
use sp_runtime::{traits::{Block as BlockT, NumberFor}, ConsensusEngineId, Justification};
use std::{borrow::Cow, collections::VecDeque, iter, task::{Context, Poll}, time::Duration};
use std::{
borrow::Cow,
collections::{HashSet, VecDeque},
iter,
task::{Context, Poll},
time::Duration,
};
/// General behaviour of the network. Combines all protocols together.
#[derive(NetworkBehaviour)]
@@ -124,7 +130,7 @@ impl<B: BlockT, H: ExHashT> Behaviour<B, H> {
}
/// Returns the list of nodes that we know exist in the network.
pub fn known_peers(&mut self) -> impl Iterator<Item = &PeerId> {
pub fn known_peers(&mut self) -> HashSet<PeerId> {
self.discovery.known_peers()
}