mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add established timestamp to peerinfo (#5350)
This commit is contained in:
@ -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.
|
||||
|
||||
@ -146,6 +146,7 @@ impl ActiveSessionHandle {
|
||||
client_version: self.client_version.clone(),
|
||||
eth_version: self.version,
|
||||
status: self.status.clone(),
|
||||
session_established: self.established,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user