mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 17:18:08 -05:00
feat(net): add remote_addr to session established event (#2373)
This commit is contained in:
@@ -663,6 +663,7 @@ where
|
||||
}
|
||||
this.event_listeners.send(NetworkEvent::SessionEstablished {
|
||||
peer_id,
|
||||
remote_addr,
|
||||
capabilities,
|
||||
version,
|
||||
status,
|
||||
@@ -855,6 +856,8 @@ pub enum NetworkEvent {
|
||||
SessionEstablished {
|
||||
/// The identifier of the peer to which a session was established.
|
||||
peer_id: PeerId,
|
||||
/// The remote addr of the peer to which a session was established.
|
||||
remote_addr: SocketAddr,
|
||||
/// Capabilities the peer announced
|
||||
capabilities: Arc<Capabilities>,
|
||||
/// A request channel to the session task.
|
||||
|
||||
@@ -795,6 +795,7 @@ mod tests {
|
||||
match ev {
|
||||
NetworkEvent::SessionEstablished {
|
||||
peer_id,
|
||||
remote_addr,
|
||||
capabilities,
|
||||
messages,
|
||||
status,
|
||||
@@ -803,6 +804,7 @@ mod tests {
|
||||
// to insert a new peer in transactions peerset
|
||||
transactions.on_network_event(NetworkEvent::SessionEstablished {
|
||||
peer_id,
|
||||
remote_addr,
|
||||
capabilities,
|
||||
messages,
|
||||
status,
|
||||
@@ -870,12 +872,14 @@ mod tests {
|
||||
match ev {
|
||||
NetworkEvent::SessionEstablished {
|
||||
peer_id,
|
||||
remote_addr,
|
||||
capabilities,
|
||||
messages,
|
||||
status,
|
||||
version,
|
||||
} => transactions.on_network_event(NetworkEvent::SessionEstablished {
|
||||
peer_id,
|
||||
remote_addr,
|
||||
capabilities,
|
||||
messages,
|
||||
status,
|
||||
|
||||
Reference in New Issue
Block a user