@@ -637,31 +637,46 @@ pub fn collect_rpc_peers_info(state: &crate::State) -> Vec<RpcPeerInfo> {
637
637
. iter ( )
638
638
. map ( |( peer_id, state) | {
639
639
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 {
641
641
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
+ ) ,
648
654
} ,
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
+ ) ,
655
667
p2p:: P2pPeerStatus :: Ready ( r) => (
656
668
PeerConnectionStatus :: Connected ,
657
669
r. connected_since . into ( ) ,
658
670
r. is_incoming ,
671
+ None ,
659
672
) ,
660
673
} ;
661
674
RpcPeerInfo {
662
675
peer_id : * peer_id,
663
676
connection_status,
677
+ connecting_details,
664
678
address : state. dial_opts . as_ref ( ) . map ( |opts| opts. to_string ( ) ) ,
679
+ is_libp2p : state. is_libp2p ,
665
680
incoming,
666
681
best_tip : best_tip. map ( |bt| bt. hash . clone ( ) ) ,
667
682
best_tip_height : best_tip. map ( |bt| bt. height ( ) ) ,
0 commit comments