@@ -401,7 +401,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
401401 bool IsVersionSelected () const { return m_details_level == 3 || m_details_level == 4 ; }
402402 bool m_is_asmap_on{false };
403403 size_t m_max_addr_length{0 };
404- size_t m_max_age_length{4 };
404+ size_t m_max_age_length{3 };
405405 size_t m_max_id_length{2 };
406406 struct Peer {
407407 std::string addr;
@@ -418,6 +418,8 @@ class NetinfoRequestHandler : public BaseRequestHandler
418418 int id;
419419 int mapped_as;
420420 int version;
421+ bool is_bip152_hb_from;
422+ bool is_bip152_hb_to;
421423 bool is_block_relay;
422424 bool is_outbound;
423425 bool operator <(const Peer& rhs) const { return std::tie (is_outbound, min_ping) < std::tie (rhs.is_outbound , rhs.min_ping ); }
@@ -506,7 +508,9 @@ class NetinfoRequestHandler : public BaseRequestHandler
506508 const std::string addr{peer[" addr" ].get_str ()};
507509 const std::string age{conn_time == 0 ? " " : ToString ((m_time_now - conn_time) / 60 )};
508510 const std::string sub_version{peer[" subver" ].get_str ()};
509- 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});
511+ const bool is_bip152_hb_from{peer[" bip152_hb_from" ].get_bool ()};
512+ const bool is_bip152_hb_to{peer[" bip152_hb_to" ].get_bool ()};
513+ 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});
510514 m_max_addr_length = std::max (addr.length () + 1 , m_max_addr_length);
511515 m_max_age_length = std::max (age.length (), m_max_age_length);
512516 m_max_id_length = std::max (ToString (peer_id).length (), m_max_id_length);
@@ -520,13 +524,13 @@ class NetinfoRequestHandler : public BaseRequestHandler
520524 // Report detailed peer connections list sorted by direction and minimum ping time.
521525 if (DetailsRequested () && !m_peers.empty ()) {
522526 std::sort (m_peers.begin (), m_peers.end ());
523- result += strprintf (" <-> type net mping ping send recv txn blk %*s " , m_max_age_length, " age" );
527+ result += strprintf (" <-> type net mping ping send recv txn blk hb %*s " , m_max_age_length, " age" );
524528 if (m_is_asmap_on) result += " asmap " ;
525529 result += strprintf (" %*s %-*s%s\n " , m_max_id_length, " id" , IsAddressSelected () ? m_max_addr_length : 0 , IsAddressSelected () ? " address" : " " , IsVersionSelected () ? " version" : " " );
526530 for (const Peer& peer : m_peers) {
527531 std::string version{ToString (peer.version ) + peer.sub_version };
528532 result += strprintf (
529- " %3s %6s %5s%7s%7s%5s%5s%5s%5s %*s%*i %*s %-*s%s\n " ,
533+ " %3s %6s %5s%7s%7s%5s%5s%5s%5s %2s %*s%*i %*s %-*s%s\n " ,
530534 peer.is_outbound ? " out" : " in" ,
531535 ConnectionTypeForNetinfo (peer.conn_type ),
532536 peer.network ,
@@ -536,6 +540,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
536540 peer.last_recv == 0 ? " " : ToString (m_time_now - peer.last_recv ),
537541 peer.last_trxn == 0 ? " " : ToString ((m_time_now - peer.last_trxn ) / 60 ),
538542 peer.last_blck == 0 ? " " : ToString ((m_time_now - peer.last_blck ) / 60 ),
543+ strprintf (" %s%s" , peer.is_bip152_hb_to ? " ." : " " , peer.is_bip152_hb_from ? " *" : " " ),
539544 m_max_age_length, // variable spacing
540545 peer.age ,
541546 m_is_asmap_on ? 7 : 0 , // variable spacing
@@ -546,7 +551,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
546551 IsAddressSelected () ? peer.addr : " " ,
547552 IsVersionSelected () && version != " 0" ? version : " " );
548553 }
549- result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
554+ result += strprintf (" ms ms sec sec min min %*s\n\n " , m_max_age_length, " min" );
550555 }
551556
552557 // Report peer connection totals by type.
@@ -632,6 +637,9 @@ class NetinfoRequestHandler : public BaseRequestHandler
632637 " recv Time since last message received from the peer, in seconds\n "
633638 " txn Time since last novel transaction received from the peer and accepted into our mempool, in minutes\n "
634639 " blk Time since last novel block passing initial validity checks received from the peer, in minutes\n "
640+ " hb High-bandwidth BIP152 compact block relay\n "
641+ " \" .\" (to) - we selected the peer as a high-bandwidth peer\n "
642+ " \" *\" (from) - the peer selected us as a high-bandwidth peer\n "
635643 " age Duration of connection to the peer, in minutes\n "
636644 " asmap Mapped AS (Autonomous System) number in the BGP route to the peer, used for diversifying\n "
637645 " peer selection (only displayed if the -asmap config option is set)\n "
0 commit comments