diff --git a/rpc/README.md b/rpc/README.md index 51bc4652a47..bc299133fc2 100644 --- a/rpc/README.md +++ b/rpc/README.md @@ -4082,7 +4082,7 @@ A remote node connects to the local node via the P2P network. It is often called If the connection is established by the local node, `is_outbound` is true. -* `connected_duration`: [`Uint64`](#type-uint64) - Elapsed time in seconds since the remote node is connected. +* `connected_duration`: [`Uint64`](#type-uint64) - Elapsed time in milliseconds since the remote node is connected. * `last_ping_duration`: [`Uint64`](#type-uint64) `|` `null` - Elapsed time in milliseconds since receiving the ping response from this remote node. diff --git a/rpc/src/module/net.rs b/rpc/src/module/net.rs index 66188156957..2a45b2b933a 100644 --- a/rpc/src/module/net.rs +++ b/rpc/src/module/net.rs @@ -602,7 +602,7 @@ impl NetRpc for NetRpcImpl { .map(|peer_id| peer_id.to_base58()) .unwrap_or_default(), addresses: node_addresses, - connected_duration: peer.connected_time.elapsed().as_secs().into(), + connected_duration: (peer.connected_time.elapsed().as_millis() as u64).into(), last_ping_duration: peer .ping_rtt .map(|duration| (duration.as_millis() as u64).into()), diff --git a/util/jsonrpc-types/src/net.rs b/util/jsonrpc-types/src/net.rs index d75e3f6a992..3e18248c638 100644 --- a/util/jsonrpc-types/src/net.rs +++ b/util/jsonrpc-types/src/net.rs @@ -160,7 +160,7 @@ pub struct RemoteNode { /// /// If the connection is established by the local node, `is_outbound` is true. pub is_outbound: bool, - /// Elapsed time in seconds since the remote node is connected. + /// Elapsed time in milliseconds since the remote node is connected. pub connected_duration: Uint64, /// Elapsed time in milliseconds since receiving the ping response from this remote node. ///