mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 06:57:58 +00:00
Update to libp2p v0.7.0 (#2343)
* Update to libp2p master * Fix tests * More tests fixing
This commit is contained in:
committed by
Gavin Wood
parent
e2bb429711
commit
3f06fe32f3
@@ -24,7 +24,7 @@ use futures::{Async, Future, Stream, stream, sync::oneshot, sync::mpsc};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use network_libp2p::{ProtocolId, NetworkConfiguration, Severity};
|
||||
use network_libp2p::{start_service, parse_str_addr, Service as NetworkService, ServiceEvent as NetworkServiceEvent};
|
||||
use network_libp2p::{multiaddr, RegisteredProtocol, NetworkState};
|
||||
use network_libp2p::{RegisteredProtocol, NetworkState};
|
||||
use peerset::PeersetHandle;
|
||||
use consensus::import_queue::{ImportQueue, Link};
|
||||
use runtime_primitives::{traits::{Block as BlockT, NumberFor}, ConsensusEngineId};
|
||||
@@ -370,8 +370,6 @@ pub trait ManageNetwork {
|
||||
fn remove_reserved_peer(&self, peer: PeerId);
|
||||
/// Add reserved peer
|
||||
fn add_reserved_peer(&self, peer: String) -> Result<(), String>;
|
||||
/// Returns a user-friendly identifier of our node.
|
||||
fn node_id(&self) -> Option<String>;
|
||||
}
|
||||
|
||||
impl<B: BlockT + 'static, S: NetworkSpecialization<B>> ManageNetwork for Service<B, S> {
|
||||
@@ -393,19 +391,6 @@ impl<B: BlockT + 'static, S: NetworkSpecialization<B>> ManageNetwork for Service
|
||||
self.network.lock().add_known_address(peer_id, addr);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn node_id(&self) -> Option<String> {
|
||||
let network = self.network.lock();
|
||||
let ret = network
|
||||
.listeners()
|
||||
.next()
|
||||
.map(|addr| {
|
||||
let mut addr = addr.clone();
|
||||
addr.append(multiaddr::Protocol::P2p(network.peer_id().clone().into()));
|
||||
addr.to_string()
|
||||
});
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user