@@ -322,6 +322,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
322
322
struct Peer {
323
323
std::string addr;
324
324
std::string sub_version;
325
+ std::string conn_type;
325
326
std::string network;
326
327
std::string age;
327
328
double min_ping;
@@ -387,6 +388,9 @@ class NetinfoRequestHandler : public BaseRequestHandler
387
388
" type Type of peer connection\n "
388
389
" \" full\" - full relay, the default\n "
389
390
" \" block\" - block relay; like full relay but does not relay transactions or addresses\n "
391
+ " \" manual\" - peer we manually added using RPC addnode or the -addnode/-connect config options\n "
392
+ " \" feeler\" - short-lived connection for testing addresses\n "
393
+ " \" addr\" - address fetch; short-lived connection for requesting addresses\n "
390
394
" net Network the peer connected through (\" ipv4\" , \" ipv6\" , \" onion\" , \" i2p\" , or \" cjdns\" )\n "
391
395
" mping Minimum observed ping time, in milliseconds (ms)\n "
392
396
" ping Last observed ping time, in milliseconds (ms)\n "
@@ -460,11 +464,12 @@ class NetinfoRequestHandler : public BaseRequestHandler
460
464
if (network_id == UNKNOWN_NETWORK) continue ;
461
465
const bool is_outbound{!peer[" inbound" ].get_bool ()};
462
466
const bool is_block_relay{!peer[" relaytxes" ].get_bool ()};
467
+ const std::string conn_type{peer[" connection_type" ].get_str ()};
463
468
++m_counts.at (is_outbound).at (network_id); // in/out by network
464
469
++m_counts.at (is_outbound).at (m_networks_size); // in/out overall
465
470
++m_counts.at (2 ).at (network_id); // total by network
466
471
++m_counts.at (2 ).at (m_networks_size); // total overall
467
- if (is_block_relay ) {
472
+ if (conn_type == " block-relay-only " ) {
468
473
++m_counts.at (is_outbound).at (m_networks_size + 1 ); // in/out block-relay
469
474
++m_counts.at (2 ).at (m_networks_size + 1 ); // total block-relay
470
475
}
@@ -483,7 +488,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
483
488
const std::string addr{peer[" addr" ].get_str ()};
484
489
const std::string age{conn_time == 0 ? " " : ToString ((m_time_now - conn_time) / 60 )};
485
490
const std::string sub_version{peer[" subver" ].get_str ()};
486
- m_peers.push_back ({addr, sub_version, network, age, min_ping, ping, last_blck, last_recv, last_send, last_trxn, peer_id, mapped_as, version, is_block_relay, is_outbound});
491
+ m_peers.push_back ({addr, sub_version, conn_type, network, age, min_ping, ping, last_blck, last_recv, last_send, last_trxn, peer_id, mapped_as, version, is_block_relay, is_outbound});
487
492
m_max_addr_length = std::max (addr.length () + 1 , m_max_addr_length);
488
493
m_max_age_length = std::max (age.length (), m_max_age_length);
489
494
m_max_id_length = std::max (ToString (peer_id).length (), m_max_id_length);
@@ -497,15 +502,15 @@ class NetinfoRequestHandler : public BaseRequestHandler
497
502
// Report detailed peer connections list sorted by direction and minimum ping time.
498
503
if (DetailsRequested () && !m_peers.empty ()) {
499
504
std::sort (m_peers.begin (), m_peers.end ());
500
- result += strprintf (" <-> relay net mping ping send recv txn blk %*s " , m_max_age_length, " age" );
505
+ result += strprintf (" <-> type net mping ping send recv txn blk %*s " , m_max_age_length, " age" );
501
506
if (m_is_asmap_on) result += " asmap " ;
502
507
result += strprintf (" %*s %-*s%s\n " , m_max_id_length, " id" , IsAddressSelected () ? m_max_addr_length : 0 , IsAddressSelected () ? " address" : " " , IsVersionSelected () ? " version" : " " );
503
508
for (const Peer& peer : m_peers) {
504
509
std::string version{ToString (peer.version ) + peer.sub_version };
505
510
result += strprintf (
506
- " %3s %5s %5s%7s%7s%5s%5s%5s%5s %*s%*i %*s %-*s%s\n " ,
511
+ " %3s %6s %5s%7s%7s%5s%5s%5s%5s %*s%*i %*s %-*s%s\n " ,
507
512
peer.is_outbound ? " out" : " in" ,
508
- peer.is_block_relay ? " block " : " full " ,
513
+ ConnectionTypeForNetinfo ( peer.conn_type ) ,
509
514
peer.network ,
510
515
PingTimeToString (peer.min_ping ),
511
516
PingTimeToString (peer.ping ),
@@ -523,7 +528,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
523
528
IsAddressSelected () ? peer.addr : " " ,
524
529
IsVersionSelected () && version != " 0" ? version : " " );
525
530
}
526
- result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
531
+ result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
527
532
}
528
533
529
534
// Report peer connection totals by type.
0 commit comments