Fixed statistics count.
This commit is contained in:
22
src/node.cpp
22
src/node.cpp
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user