From fb0dc586b2c1f5b8ef650121069324c5fe806cf6 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:56:32 +0100 Subject: [PATCH] API: added ZMQ last active timestamp to `network/stats` --- src/p2pool.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p2pool.cpp b/src/p2pool.cpp index 9399790..8850594 100644 --- a/src/p2pool.cpp +++ b/src/p2pool.cpp @@ -1552,13 +1552,15 @@ void p2pool::api_update_network_stats() } m_api->set(p2pool_api::Category::NETWORK, "stats", - [mainnet_tip](log::Stream& s) + [this, mainnet_tip](log::Stream& s) { s << "{\"difficulty\":" << mainnet_tip.difficulty << ",\"hash\":\"" << mainnet_tip.id << "\",\"height\":" << mainnet_tip.height << ",\"reward\":" << mainnet_tip.reward - << ",\"timestamp\":" << mainnet_tip.timestamp << "}"; + << ",\"timestamp\":" << mainnet_tip.timestamp + << ",\"zmq_last_active\":" << zmq_last_active() + << "}"; }); api_update_stats_mod();