lxmd: send no stats reply when it is not a propagation node

This commit is contained in:
DeFiDude committed 2026-11-10 08:14:57 -07:00
1 parent d3ad54a457
commit b6db122563
2 files changed
+3 -6

No files matched your search

+3 -2
View File
@@ -53,7 +53,7 @@ use lxmf_tools::lxmd_cli::{
};
use lxmf_tools::lxmd_control::{
CONTROL_APP_NAME, ControlCommandKind, ControlResponse, decode_control_response,
encode_control_success, encode_nil_response, encode_peer_error, encode_router_control_stats,
encode_control_success, encode_peer_error, encode_router_control_stats,
exit_for_control_response, format_remote_status, print_control_link_error, query_control,
resolve_remote_identity_hash,
};
@@ -2452,7 +2452,8 @@ impl LxmdRunner {
if path_hash == stats_path_hash {
tracing::info!("control: handling stats request");
Some(snapshot.stats_response.unwrap_or_else(encode_nil_response))
// compile_stats returns None off a propagation node: no response.
snapshot.stats_response
} else if path_hash == sync_path_hash {
tracing::info!("control: handling peer sync request");
if data.len() != 16 {
-4
View File
@@ -147,10 +147,6 @@ pub fn encode_control_success() -> Vec<u8> {
encode_value(&Value::Boolean(true))
}
pub fn encode_nil_response() -> Vec<u8> {
encode_value(&Value::Nil)
}
pub fn encode_router_control_stats(
router: &LxmRouter,
identity_hash: [u8; 16],