@@ -406,6 +406,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
406406 std::string conn_type;
407407 std::string network;
408408 std::string age;
409+ std::string transport_protocol_type;
409410 double min_ping;
410411 double ping;
411412 int64_t addr_processed;
@@ -517,10 +518,11 @@ class NetinfoRequestHandler : public BaseRequestHandler
517518 const std::string addr{peer[" addr" ].get_str ()};
518519 const std::string age{conn_time == 0 ? " " : ToString ((time_now - conn_time) / 60 )};
519520 const std::string sub_version{peer[" subver" ].get_str ()};
521+ const std::string transport{peer[" transport_protocol_type" ].get_str ()};
520522 const bool is_addr_relay_enabled{peer[" addr_relay_enabled" ].isNull () ? false : peer[" addr_relay_enabled" ].get_bool ()};
521523 const bool is_bip152_hb_from{peer[" bip152_hb_from" ].get_bool ()};
522524 const bool is_bip152_hb_to{peer[" bip152_hb_to" ].get_bool ()};
523- m_peers.push_back ({addr, sub_version, conn_type, NETWORK_SHORT_NAMES[network_id], age, min_ping, ping, addr_processed, addr_rate_limited, last_blck, last_recv, last_send, last_trxn, peer_id, mapped_as, version, is_addr_relay_enabled, is_bip152_hb_from, is_bip152_hb_to, is_outbound, is_tx_relay});
525+ m_peers.push_back ({addr, sub_version, conn_type, NETWORK_SHORT_NAMES[network_id], age, transport, min_ping, ping, addr_processed, addr_rate_limited, last_blck, last_recv, last_send, last_trxn, peer_id, mapped_as, version, is_addr_relay_enabled, is_bip152_hb_from, is_bip152_hb_to, is_outbound, is_tx_relay});
524526 m_max_addr_length = std::max (addr.length () + 1 , m_max_addr_length);
525527 m_max_addr_processed_length = std::max (ToString (addr_processed).length (), m_max_addr_processed_length);
526528 m_max_addr_rate_limited_length = std::max (ToString (addr_rate_limited).length (), m_max_addr_rate_limited_length);
@@ -536,7 +538,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
536538 // Report detailed peer connections list sorted by direction and minimum ping time.
537539 if (DetailsRequested () && !m_peers.empty ()) {
538540 std::sort (m_peers.begin (), m_peers.end ());
539- result += strprintf (" <-> type net mping ping send recv txn blk hb %*s%*s%*s " ,
541+ result += strprintf (" <-> type net tp mping ping send recv txn blk hb %*s%*s%*s " ,
540542 m_max_addr_processed_length, " addrp" ,
541543 m_max_addr_rate_limited_length, " addrl" ,
542544 m_max_age_length, " age" );
@@ -545,10 +547,11 @@ class NetinfoRequestHandler : public BaseRequestHandler
545547 for (const Peer& peer : m_peers) {
546548 std::string version{ToString (peer.version ) + peer.sub_version };
547549 result += strprintf (
548- " %3s %6s %5s%7s%7s%5s%5s%5s%5s %2s %*s%*s%*s%*i %*s %-*s%s\n " ,
550+ " %3s %6s %5s %2s %7s%7s%5s%5s%5s%5s %2s %*s%*s%*s%*i %*s %-*s%s\n " ,
549551 peer.is_outbound ? " out" : " in" ,
550552 ConnectionTypeForNetinfo (peer.conn_type ),
551553 peer.network ,
554+ peer.transport_protocol_type == " detecting" ? " *" : peer.transport_protocol_type ,
552555 PingTimeToString (peer.min_ping ),
553556 PingTimeToString (peer.ping ),
554557 peer.last_send ? ToString (time_now - peer.last_send ) : " " ,
@@ -570,7 +573,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
570573 IsAddressSelected () ? peer.addr : " " ,
571574 IsVersionSelected () && version != " 0" ? version : " " );
572575 }
573- result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
576+ result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
574577 }
575578
576579 // Report peer connection totals by type.
@@ -658,6 +661,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
658661 " \" feeler\" - short-lived connection for testing addresses\n "
659662 " \" addr\" - address fetch; short-lived connection for requesting addresses\n "
660663 " net Network the peer connected through (\" ipv4\" , \" ipv6\" , \" onion\" , \" i2p\" , \" cjdns\" , or \" npr\" (not publicly routable))\n "
664+ " tp Transport protocol used for the connection (\" v1\" , \" v2\" or \" *\" if detecting)\n "
661665 " mping Minimum observed ping time, in milliseconds (ms)\n "
662666 " ping Last observed ping time, in milliseconds (ms)\n "
663667 " send Time since last message sent to the peer, in seconds\n "
0 commit comments