aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2021-02-17 12:44:15 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2021-02-17 12:49:18 +0100
commit4dc1ff809a5d38b2b40f4e821a6b50b2ccbea259 (patch)
treec707d45d55d36499e2e6519d6d10bfdb2e2b2a9d
parent569b5ba1dc56ef1df2fc7dbf22b5fdbf35c87556 (diff)
parent882ce25132e1b6880916fa154850a708e6a968b2 (diff)
Merge #21192: cli: Treat high detail levels as maximum in -netinfo
882ce25132e1b6880916fa154850a708e6a968b2 cli: Treat high detail levels as the maximum in -netinfo (Wladimir J. van der Laan) Pull request description: I somehow often type `-netinfo 5` which gets treated as `-netinfo 0`, after this change it's `-netinfo 4` which seems more convenient behavior. ACKs for top commit: jonatack: ACK 882ce25132e1b6880916fa154850a708e6a968b2 theStack: Tested ACK 882ce25132e1b6880916fa154850a708e6a968b2 Tree-SHA512: 5ed13213d00940c81f70c5fe5092f5fcc78c0184e1cc83b6c58a7bf24cf0f634816ce28f468aac588a4d202a6a7c1b411c0690099f1a8bf1999e662de4afcccd
-rw-r--r--src/bitcoin-cli.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index a9a0ec6f5d..0830cb54cb 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -302,6 +302,7 @@ private:
static constexpr int8_t UNKNOWN_NETWORK{-1};
static constexpr int8_t NET_I2P{3}; // pos of "i2p" in m_networks
static constexpr uint8_t m_networks_size{4};
+ static constexpr uint8_t MAX_DETAIL_LEVEL{4};
const std::array<std::string, m_networks_size> m_networks{{"ipv4", "ipv6", "onion", "i2p"}};
std::array<std::array<uint16_t, m_networks_size + 1>, 3> m_counts{{{}}}; //!< Peer counts by (in/out/total, networks/total)
uint8_t m_block_relay_peers_count{0};
@@ -439,7 +440,7 @@ public:
if (!args.empty()) {
uint8_t n{0};
if (ParseUInt8(args.at(0), &n)) {
- m_details_level = n;
+ m_details_level = std::min(n, MAX_DETAIL_LEVEL);
} else if (args.at(0) == "help") {
m_is_help_requested = true;
} else {