@@ -637,31 +637,46 @@ pub fn collect_rpc_peers_info(state: &crate::State) -> Vec<RpcPeerInfo> {
637637 . iter ( )
638638 . map ( |( peer_id, state) | {
639639 let best_tip = state. status . as_ready ( ) . and_then ( |r| r. best_tip . as_ref ( ) ) ;
640- let ( connection_status, time, incoming) = match & state. status {
640+ let ( connection_status, time, incoming, connecting_details ) = match & state. status {
641641 p2p:: P2pPeerStatus :: Connecting ( c) => match c {
642- p2p:: connection:: P2pConnectionState :: Outgoing ( o) => {
643- ( PeerConnectionStatus :: Connecting , o. time ( ) . into ( ) , false )
644- }
645- p2p:: connection:: P2pConnectionState :: Incoming ( i) => {
646- ( PeerConnectionStatus :: Connecting , i. time ( ) . into ( ) , true )
647- }
642+ p2p:: connection:: P2pConnectionState :: Outgoing ( o) => (
643+ PeerConnectionStatus :: Connecting ,
644+ o. time ( ) . into ( ) ,
645+ false ,
646+ Some ( format ! ( "{o:?}" ) ) ,
647+ ) ,
648+ p2p:: connection:: P2pConnectionState :: Incoming ( i) => (
649+ PeerConnectionStatus :: Connecting ,
650+ i. time ( ) . into ( ) ,
651+ true ,
652+ Some ( format ! ( "{i:?}" ) ) ,
653+ ) ,
648654 } ,
649- p2p:: P2pPeerStatus :: Disconnecting { time } => {
650- ( PeerConnectionStatus :: Disconnected , ( * time) . into ( ) , false )
651- }
652- p2p:: P2pPeerStatus :: Disconnected { time } => {
653- ( PeerConnectionStatus :: Disconnected , ( * time) . into ( ) , false )
654- }
655+ p2p:: P2pPeerStatus :: Disconnecting { time } => (
656+ PeerConnectionStatus :: Disconnecting ,
657+ ( * time) . into ( ) ,
658+ false ,
659+ None ,
660+ ) ,
661+ p2p:: P2pPeerStatus :: Disconnected { time } => (
662+ PeerConnectionStatus :: Disconnected ,
663+ ( * time) . into ( ) ,
664+ false ,
665+ None ,
666+ ) ,
655667 p2p:: P2pPeerStatus :: Ready ( r) => (
656668 PeerConnectionStatus :: Connected ,
657669 r. connected_since . into ( ) ,
658670 r. is_incoming ,
671+ None ,
659672 ) ,
660673 } ;
661674 RpcPeerInfo {
662675 peer_id : * peer_id,
663676 connection_status,
677+ connecting_details,
664678 address : state. dial_opts . as_ref ( ) . map ( |opts| opts. to_string ( ) ) ,
679+ is_libp2p : state. is_libp2p ,
665680 incoming,
666681 best_tip : best_tip. map ( |bt| bt. hash . clone ( ) ) ,
667682 best_tip_height : best_tip. map ( |bt| bt. height ( ) ) ,
0 commit comments