Skip to content

Commit 9cd6682

Browse files
committed
Make getpeerinfo field order consistent with its help (for v24 backport)
This also keeps it consistent with the last release (v23)
1 parent 3d892d8 commit 9cd6682

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/rpc/net.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ static RPCHelpMan getpeerinfo()
200200
ServiceFlags services{fStateStats ? statestats.their_services : ServiceFlags::NODE_NONE};
201201
obj.pushKV("services", strprintf("%016x", services));
202202
obj.pushKV("servicesnames", GetServicesNames(services));
203+
if (fStateStats) {
204+
obj.pushKV("relaytxes", statestats.m_relay_txs);
205+
}
203206
obj.pushKV("lastsend", count_seconds(stats.m_last_send));
204207
obj.pushKV("lastrecv", count_seconds(stats.m_last_recv));
205208
obj.pushKV("last_transaction", count_seconds(stats.m_last_tx_time));
@@ -235,8 +238,6 @@ static RPCHelpMan getpeerinfo()
235238
heights.push_back(height);
236239
}
237240
obj.pushKV("inflight", heights);
238-
obj.pushKV("relaytxes", statestats.m_relay_txs);
239-
obj.pushKV("minfeefilter", ValueFromAmount(statestats.m_fee_filter_received));
240241
obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled);
241242
obj.pushKV("addr_processed", statestats.m_addr_processed);
242243
obj.pushKV("addr_rate_limited", statestats.m_addr_rate_limited);
@@ -246,6 +247,9 @@ static RPCHelpMan getpeerinfo()
246247
permissions.push_back(permission);
247248
}
248249
obj.pushKV("permissions", permissions);
250+
if (fStateStats) {
251+
obj.pushKV("minfeefilter", ValueFromAmount(statestats.m_fee_filter_received));
252+
}
249253

250254
UniValue sendPerMsgType(UniValue::VOBJ);
251255
for (const auto& i : stats.mapSendBytesPerMsgType) {

0 commit comments

Comments
 (0)