diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index ef4641cb63ad09..e69efc98c64d48 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -299,8 +299,8 @@ class NetinfoRequestHandler : public BaseRequestHandler { private: static constexpr int8_t UNKNOWN_NETWORK{-1}; - static constexpr uint8_t m_networks_size{3}; - const std::array m_networks{{"ipv4", "ipv6", "onion"}}; + static constexpr uint8_t m_networks_size{4}; + const std::array m_networks{{"ipv4", "ipv6", "onion", "i2p"}}; std::array, 3> m_counts{{{}}}; //!< Peer counts by (in/out/total, networks/total/block-relay) int8_t NetworkStringToId(const std::string& str) const { @@ -454,10 +454,10 @@ class NetinfoRequestHandler : public BaseRequestHandler } // Report peer connection totals by type. - result += " ipv4 ipv6 onion total block-relay\n"; + result += " ipv4 ipv6 onion i2p total block-relay\n"; const std::array rows{{"in", "out", "total"}}; - for (uint8_t i = 0; i < m_networks_size; ++i) { - result += strprintf("%-5s %5i %5i %5i %5i %5i\n", rows.at(i), m_counts.at(i).at(0), m_counts.at(i).at(1), m_counts.at(i).at(2), m_counts.at(i).at(m_networks_size), m_counts.at(i).at(m_networks_size + 1)); + for (uint8_t i = 0; i < 3; ++i) { + result += strprintf("%-5s %5i %5i %5i %5i %5i %5i\n", rows.at(i), m_counts.at(i).at(0), m_counts.at(i).at(1), m_counts.at(i).at(2), m_counts.at(i).at(3), m_counts.at(i).at(m_networks_size), m_counts.at(i).at(m_networks_size + 1)); } // Report local addresses, ports, and scores.