sync: remove broken eth_protocol_version method (#11473)
* sync: fix eth_protocol_version * sync: remove eth_protocol_version altogether
This commit is contained in:
parent
99271db9d3
commit
c5123e1ecd
@ -54,8 +54,6 @@ pub trait SyncIo {
|
||||
fn peer_enode(&self, peer_id: PeerId) -> Option<String>;
|
||||
/// Returns information on p2p session
|
||||
fn peer_session_info(&self, peer_id: PeerId) -> Option<SessionInfo>;
|
||||
/// Maximum mutually supported ETH protocol version
|
||||
fn eth_protocol_version(&self, peer_id: PeerId) -> u8;
|
||||
/// Maximum mutually supported version of a gien protocol.
|
||||
fn protocol_version(&self, protocol: &ProtocolId, peer_id: PeerId) -> u8;
|
||||
/// Returns if the chain block queue empty
|
||||
@ -141,10 +139,6 @@ impl<'s> SyncIo for NetSyncIo<'s> {
|
||||
self.network.session_info(peer_id)
|
||||
}
|
||||
|
||||
fn eth_protocol_version(&self, peer_id: PeerId) -> u8 {
|
||||
self.network.protocol_version(self.network.subprotocol_name(), peer_id).unwrap_or(0)
|
||||
}
|
||||
|
||||
fn protocol_version(&self, protocol: &ProtocolId, peer_id: PeerId) -> u8 {
|
||||
self.network.protocol_version(*protocol, peer_id).unwrap_or(0)
|
||||
}
|
||||
|
@ -155,12 +155,8 @@ impl<'p, C> SyncIo for TestIo<'p, C> where C: FlushingBlockChainClient, C: 'p {
|
||||
None
|
||||
}
|
||||
|
||||
fn eth_protocol_version(&self, _peer: PeerId) -> u8 {
|
||||
ETH_PROTOCOL_VERSION_63.0
|
||||
}
|
||||
|
||||
fn protocol_version(&self, protocol: &ProtocolId, peer_id: PeerId) -> u8 {
|
||||
if protocol == &WARP_SYNC_PROTOCOL_ID { PAR_PROTOCOL_VERSION_4.0 } else { self.eth_protocol_version(peer_id) }
|
||||
fn protocol_version(&self, protocol: &ProtocolId, _peer_id: PeerId) -> u8 {
|
||||
if protocol == &WARP_SYNC_PROTOCOL_ID { PAR_PROTOCOL_VERSION_4.0 } else { ETH_PROTOCOL_VERSION_63.0 }
|
||||
}
|
||||
|
||||
fn is_expired(&self) -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user