diff options
author | Jon Atack <jon@atack.com> | 2022-09-16 14:47:12 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-09-22 16:44:38 +0200 |
commit | 9cd6682545e845277d2207654250d1ed78d0c695 (patch) | |
tree | d35bd6a70ad40985cda42237aa5c42f8b7cb3d75 | |
parent | 3d892d8695850e8a45e0d8b831ef66cba5e0e375 (diff) |
Make getpeerinfo field order consistent with its help (for v24 backport)
This also keeps it consistent with the last release (v23)
-rw-r--r-- | src/rpc/net.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index e221b3462d..8f166597d4 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -200,6 +200,9 @@ static RPCHelpMan getpeerinfo() ServiceFlags services{fStateStats ? statestats.their_services : ServiceFlags::NODE_NONE}; obj.pushKV("services", strprintf("%016x", services)); obj.pushKV("servicesnames", GetServicesNames(services)); + if (fStateStats) { + obj.pushKV("relaytxes", statestats.m_relay_txs); + } obj.pushKV("lastsend", count_seconds(stats.m_last_send)); obj.pushKV("lastrecv", count_seconds(stats.m_last_recv)); obj.pushKV("last_transaction", count_seconds(stats.m_last_tx_time)); @@ -235,8 +238,6 @@ static RPCHelpMan getpeerinfo() heights.push_back(height); } obj.pushKV("inflight", heights); - obj.pushKV("relaytxes", statestats.m_relay_txs); - obj.pushKV("minfeefilter", ValueFromAmount(statestats.m_fee_filter_received)); obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled); obj.pushKV("addr_processed", statestats.m_addr_processed); obj.pushKV("addr_rate_limited", statestats.m_addr_rate_limited); @@ -246,6 +247,9 @@ static RPCHelpMan getpeerinfo() permissions.push_back(permission); } obj.pushKV("permissions", permissions); + if (fStateStats) { + obj.pushKV("minfeefilter", ValueFromAmount(statestats.m_fee_filter_received)); + } UniValue sendPerMsgType(UniValue::VOBJ); for (const auto& i : stats.mapSendBytesPerMsgType) { |