@@ -318,7 +318,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
318
318
bool IsVersionSelected () const { return m_details_level == 3 || m_details_level == 4 ; }
319
319
bool m_is_asmap_on{false };
320
320
size_t m_max_addr_length{0 };
321
- size_t m_max_age_length{4 };
321
+ size_t m_max_age_length{3 };
322
322
size_t m_max_id_length{2 };
323
323
struct Peer {
324
324
std::string addr;
@@ -335,6 +335,8 @@ class NetinfoRequestHandler : public BaseRequestHandler
335
335
int id;
336
336
int mapped_as;
337
337
int version;
338
+ bool is_bip152_hb_from;
339
+ bool is_bip152_hb_to;
338
340
bool is_block_relay;
339
341
bool is_outbound;
340
342
bool operator <(const Peer& rhs) const { return std::tie (is_outbound, min_ping) < std::tie (rhs.is_outbound , rhs.min_ping ); }
@@ -399,6 +401,9 @@ class NetinfoRequestHandler : public BaseRequestHandler
399
401
" recv Time since last message received from the peer, in seconds\n "
400
402
" txn Time since last novel transaction received from the peer and accepted into our mempool, in minutes\n "
401
403
" blk Time since last novel block passing initial validity checks received from the peer, in minutes\n "
404
+ " hb High-bandwidth BIP152 compact block relay\n "
405
+ " \" .\" (to) - we selected the peer as a high-bandwidth peer\n "
406
+ " \" *\" (from) - the peer selected us as a high-bandwidth peer\n "
402
407
" age Duration of connection to the peer, in minutes\n "
403
408
" asmap Mapped AS (Autonomous System) number in the BGP route to the peer, used for diversifying\n "
404
409
" peer selection (only displayed if the -asmap config option is set)\n "
@@ -490,7 +495,9 @@ class NetinfoRequestHandler : public BaseRequestHandler
490
495
const std::string addr{peer[" addr" ].get_str ()};
491
496
const std::string age{conn_time == 0 ? " " : ToString ((m_time_now - conn_time) / 60 )};
492
497
const std::string sub_version{peer[" subver" ].get_str ()};
493
- 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});
498
+ const bool is_bip152_hb_from{peer[" bip152_hb_from" ].get_bool ()};
499
+ const bool is_bip152_hb_to{peer[" bip152_hb_to" ].get_bool ()};
500
+ 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_bip152_hb_from, is_bip152_hb_to, is_block_relay, is_outbound});
494
501
m_max_addr_length = std::max (addr.length () + 1 , m_max_addr_length);
495
502
m_max_age_length = std::max (age.length (), m_max_age_length);
496
503
m_max_id_length = std::max (ToString (peer_id).length (), m_max_id_length);
@@ -504,13 +511,13 @@ class NetinfoRequestHandler : public BaseRequestHandler
504
511
// Report detailed peer connections list sorted by direction and minimum ping time.
505
512
if (DetailsRequested () && !m_peers.empty ()) {
506
513
std::sort (m_peers.begin (), m_peers.end ());
507
- result += strprintf (" <-> type net mping ping send recv txn blk %*s " , m_max_age_length, " age" );
514
+ result += strprintf (" <-> type net mping ping send recv txn blk hb %*s " , m_max_age_length, " age" );
508
515
if (m_is_asmap_on) result += " asmap " ;
509
516
result += strprintf (" %*s %-*s%s\n " , m_max_id_length, " id" , IsAddressSelected () ? m_max_addr_length : 0 , IsAddressSelected () ? " address" : " " , IsVersionSelected () ? " version" : " " );
510
517
for (const Peer& peer : m_peers) {
511
518
std::string version{ToString (peer.version ) + peer.sub_version };
512
519
result += strprintf (
513
- " %3s %6s %5s%7s%7s%5s%5s%5s%5s %*s%*i %*s %-*s%s\n " ,
520
+ " %3s %6s %5s%7s%7s%5s%5s%5s%5s %2s %*s%*i %*s %-*s%s\n " ,
514
521
peer.is_outbound ? " out" : " in" ,
515
522
ConnectionTypeForNetinfo (peer.conn_type ),
516
523
peer.network ,
@@ -520,6 +527,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
520
527
peer.last_recv == 0 ? " " : ToString (m_time_now - peer.last_recv ),
521
528
peer.last_trxn == 0 ? " " : ToString ((m_time_now - peer.last_trxn ) / 60 ),
522
529
peer.last_blck == 0 ? " " : ToString ((m_time_now - peer.last_blck ) / 60 ),
530
+ strprintf (" %s%s" , peer.is_bip152_hb_to ? " ." : " " , peer.is_bip152_hb_from ? " *" : " " ),
523
531
m_max_age_length, // variable spacing
524
532
peer.age ,
525
533
m_is_asmap_on ? 7 : 0 , // variable spacing
@@ -530,7 +538,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
530
538
IsAddressSelected () ? peer.addr : " " ,
531
539
IsVersionSelected () && version != " 0" ? version : " " );
532
540
}
533
- result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
541
+ result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
534
542
}
535
543
536
544
// Report peer connection totals by type.
0 commit comments