Compatibility with whisper v6 (#6179)

* compatibility with whisper v6

* separate subprotocol for parity extensions

* kill version field
This commit is contained in:
Robert Habermeier
2017-09-10 18:02:14 +02:00
committed by Gav Wood
parent 246b5282e5
commit 375668bc40
12 changed files with 349 additions and 172 deletions

View File

@@ -497,6 +497,8 @@ pub trait ManageNetwork : Send + Sync {
fn stop_network(&self);
/// Query the current configuration of the network
fn network_config(&self) -> NetworkConfiguration;
/// Get network context for protocol.
fn with_proto_context(&self, proto: ProtocolId, f: &mut FnMut(&NetworkContext));
}
@@ -538,6 +540,10 @@ impl ManageNetwork for EthSync {
fn network_config(&self) -> NetworkConfiguration {
NetworkConfiguration::from(self.network.config().clone())
}
fn with_proto_context(&self, proto: ProtocolId, f: &mut FnMut(&NetworkContext)) {
self.network.with_context_eval(proto, f);
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -808,6 +814,10 @@ impl ManageNetwork for LightSync {
fn network_config(&self) -> NetworkConfiguration {
NetworkConfiguration::from(self.network.config().clone())
}
fn with_proto_context(&self, proto: ProtocolId, f: &mut FnMut(&NetworkContext)) {
self.network.with_context_eval(proto, f);
}
}
impl LightSyncProvider for LightSync {