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