Skip to content

Commit

Permalink
API: added ZMQ last active timestamp to network/stats
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Dec 29, 2024
1 parent 0d33214 commit fb0dc58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/p2pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit fb0dc58

Please sign in to comment.