Fixed statistics count.

This commit is contained in:
Nicolás Ortega Froysa
2017-11-10 16:26:34 +01:00
parent fc94e08e31
commit 64fbe3ec9c
3 changed files with 27 additions and 16 deletions

View File

@ -117,20 +117,14 @@ unsigned int NeoComm_count_connected_nodes() {
return node.getNodesStats(AF_UNSPEC).getKnownNodes();
}
const char *NeoComm_get_node_stats() {
unsigned int good, dubious, cached, incoming, total;
total = node.getNodesStats(
struct stats NeoComm_get_node_stats() {
struct stats statistics;
node.getNodesStats(
AF_UNSPEC,
&good,
&dubious,
&cached,
&incoming);
std::string stats;
stats += "Good: " + good + std::string("\n");
stats += "Dubious: " + dubious + std::string("\n");
stats += "Cached: " + cached + std::string("\n");
stats += "Incoming: " + incoming + std::string("\n");
stats += "Total: " + total + std::string("\n");
&statistics.good,
&statistics.dubious,
&statistics.cached,
&statistics.incoming);
return stats.c_str();
return statistics;
}