Skip to content

Commit

Permalink
cli: add i2p network to -netinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack authored and vasild committed Dec 16, 2020
1 parent 855267e commit df3156e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, m_networks_size> m_networks{{"ipv4", "ipv6", "onion"}};
static constexpr uint8_t m_networks_size{4};
const std::array<std::string, m_networks_size> m_networks{{"ipv4", "ipv6", "onion", "i2p"}};
std::array<std::array<uint16_t, m_networks_size + 2>, 3> m_counts{{{}}}; //!< Peer counts by (in/out/total, networks/total/block-relay)
int8_t NetworkStringToId(const std::string& str) const
{
Expand Down Expand Up @@ -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<std::string, 3> 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.
Expand Down

0 comments on commit df3156e

Please sign in to comment.