Skip to content

Commit 0b16b50

Browse files
committed
cli: fix loop counter comparison in ProcessReply
The loop is supposed to iterate for `rows.size()` (which is `3`, and this change is done in bitcoin#23324), not for `m_networks.size()` (which is also `3` but subsequent backports change that).
1 parent e4c848b commit 0b16b50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
595595
// Report peer connection totals by type.
596596
result += " ipv4 ipv6 onion total block-relay\n";
597597
const std::array rows{"in", "out", "total"};
598-
for (uint8_t i = 0; i < m_networks.size(); ++i) {
598+
for (uint8_t i = 0; i < 3; ++i) {
599599
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));
600600
}
601601

0 commit comments

Comments
 (0)