@@ -641,31 +641,46 @@ pub fn collect_rpc_peers_info(state: &crate::State) -> Vec<RpcPeerInfo> {
641641 . iter ( )
642642 . map ( |( peer_id, state) | {
643643 let best_tip = state. status . as_ready ( ) . and_then ( |r| r. best_tip . as_ref ( ) ) ;
644- let ( connection_status, time, incoming) = match & state. status {
644+ let ( connection_status, time, incoming, connecting_details ) = match & state. status {
645645 p2p:: P2pPeerStatus :: Connecting ( c) => match c {
646- p2p:: connection:: P2pConnectionState :: Outgoing ( o) => {
647- ( PeerConnectionStatus :: Connecting , o. time ( ) . into ( ) , false )
648- }
649- p2p:: connection:: P2pConnectionState :: Incoming ( i) => {
650- ( PeerConnectionStatus :: Connecting , i. time ( ) . into ( ) , true )
651- }
646+ p2p:: connection:: P2pConnectionState :: Outgoing ( o) => (
647+ PeerConnectionStatus :: Connecting ,
648+ o. time ( ) . into ( ) ,
649+ false ,
650+ Some ( format ! ( "{o:?}" ) ) ,
651+ ) ,
652+ p2p:: connection:: P2pConnectionState :: Incoming ( i) => (
653+ PeerConnectionStatus :: Connecting ,
654+ i. time ( ) . into ( ) ,
655+ true ,
656+ Some ( format ! ( "{i:?}" ) ) ,
657+ ) ,
652658 } ,
653- p2p:: P2pPeerStatus :: Disconnecting { time } => {
654- ( PeerConnectionStatus :: Disconnected , ( * time) . into ( ) , false )
655- }
656- p2p:: P2pPeerStatus :: Disconnected { time } => {
657- ( PeerConnectionStatus :: Disconnected , ( * time) . into ( ) , false )
658- }
659+ p2p:: P2pPeerStatus :: Disconnecting { time } => (
660+ PeerConnectionStatus :: Disconnecting ,
661+ ( * time) . into ( ) ,
662+ false ,
663+ None ,
664+ ) ,
665+ p2p:: P2pPeerStatus :: Disconnected { time } => (
666+ PeerConnectionStatus :: Disconnected ,
667+ ( * time) . into ( ) ,
668+ false ,
669+ None ,
670+ ) ,
659671 p2p:: P2pPeerStatus :: Ready ( r) => (
660672 PeerConnectionStatus :: Connected ,
661673 r. connected_since . into ( ) ,
662674 r. is_incoming ,
675+ None ,
663676 ) ,
664677 } ;
665678 RpcPeerInfo {
666679 peer_id : * peer_id,
667680 connection_status,
681+ connecting_details,
668682 address : state. dial_opts . as_ref ( ) . map ( |opts| opts. to_string ( ) ) ,
683+ is_libp2p : state. is_libp2p ,
669684 incoming,
670685 best_tip : best_tip. map ( |bt| bt. hash . clone ( ) ) ,
671686 best_tip_height : best_tip. map ( |bt| bt. height ( ) ) ,
0 commit comments