feat: add established timestamp to peerinfo (#5350)

This commit is contained in:
Matthias Seitz
2023-11-08 04:12:04 +01:00
committed by GitHub
parent 1b2a4c71c7
commit 5daaa7fe27
2 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,7 @@ use async_trait::async_trait;
use reth_eth_wire::{DisconnectReason, EthVersion, Status};
use reth_primitives::{NodeRecord, PeerId};
use reth_rpc_types::NetworkStatus;
use std::{net::SocketAddr, sync::Arc};
use std::{net::SocketAddr, sync::Arc, time::Instant};
pub use error::NetworkError;
pub use reputation::{Reputation, ReputationChangeKind};
@ -131,6 +131,8 @@ pub struct PeerInfo {
pub eth_version: EthVersion,
/// The Status message the peer sent for the `eth` handshake
pub status: Arc<Status>,
/// The timestamp when the session to that peer has been established.
pub session_established: Instant,
}
/// The direction of the connection.

View File

@ -146,6 +146,7 @@ impl ActiveSessionHandle {
client_version: self.client_version.clone(),
eth_version: self.version,
status: self.status.clone(),
session_established: self.established,
}
}
}