Skip to content

Commit

Permalink
litep2p: Remove unneeded event fields
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
  • Loading branch information
lexnv committed Nov 15, 2024
1 parent 3217d01 commit e606a38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions substrate/client/network/src/litep2p/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ pub enum DiscoveryEvent {
/// Peer ID.
peer: PeerId,

/// Identify protocol version.
protocol_version: Option<String>,

/// Identify user agent version.
user_agent: Option<String>,

/// Observed address.
observed_address: Multiaddr,

/// Listen addresses.
listen_addresses: Vec<Multiaddr>,

Expand Down Expand Up @@ -600,11 +591,10 @@ impl Stream for Discovery {
Poll::Ready(None) => return Poll::Ready(None),
Poll::Ready(Some(IdentifyEvent::PeerIdentified {
peer,
protocol_version,
user_agent,
listen_addresses,
supported_protocols,
observed_address,
..
})) => {
let observed_address =
if let Some(Protocol::P2p(peer_id)) = observed_address.iter().last() {
Expand Down Expand Up @@ -647,10 +637,7 @@ impl Stream for Discovery {

return Poll::Ready(Some(DiscoveryEvent::Identified {
peer,
protocol_version,
user_agent,
listen_addresses,
observed_address,
supported_protocols,
}));
},
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/network/src/litep2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkBackend<B, H> for Litep2pNetworkBac
}
}
}
Some(DiscoveryEvent::Identified { peer, listen_addresses, supported_protocols, .. }) => {
Some(DiscoveryEvent::Identified { peer, listen_addresses, supported_protocols }) => {
self.discovery.add_self_reported_address(peer, supported_protocols, listen_addresses).await;
}
Some(DiscoveryEvent::ExternalAddressDiscovered { address }) => {
Expand Down

0 comments on commit e606a38

Please sign in to comment.