Skip to content

Commit 34193fa

Browse files
jonatackvasild
authored andcommitted
cli: add i2p network to -netinfo
1 parent cb69185 commit 34193fa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bitcoin-cli.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ class NetinfoRequestHandler : public BaseRequestHandler
299299
{
300300
private:
301301
static constexpr int8_t UNKNOWN_NETWORK{-1};
302-
static constexpr uint8_t m_networks_size{3};
303-
const std::array<std::string, m_networks_size> m_networks{{"ipv4", "ipv6", "onion"}};
302+
static constexpr uint8_t m_networks_size{4};
303+
const std::array<std::string, m_networks_size> m_networks{{"ipv4", "ipv6", "onion", "i2p"}};
304304
std::array<std::array<uint16_t, m_networks_size + 2>, 3> m_counts{{{}}}; //!< Peer counts by (in/out/total, networks/total/block-relay)
305305
int8_t NetworkStringToId(const std::string& str) const
306306
{
@@ -454,10 +454,10 @@ class NetinfoRequestHandler : public BaseRequestHandler
454454
}
455455

456456
// Report peer connection totals by type.
457-
result += " ipv4 ipv6 onion total block-relay\n";
457+
result += " ipv4 ipv6 onion i2p total block-relay\n";
458458
const std::array<std::string, 3> rows{{"in", "out", "total"}};
459-
for (uint8_t i = 0; i < m_networks_size; ++i) {
460-
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));
459+
for (uint8_t i = 0; i < 3; ++i) {
460+
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));
461461
}
462462

463463
// Report local addresses, ports, and scores.

0 commit comments

Comments
 (0)