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

@ -61,7 +61,14 @@ int main(int argc, char *argv[]) {
if(strcmp(in, "/exit") == 0 || strcmp(in, "/quit") == 0)
run = 0;
else if(strcmp(in, "/stats") == 0)
printf("%s", NeoComm_get_node_stats());
{
struct stats statistics = NeoComm_get_node_stats();
printf("Good: %u\nDubious: %u\nCached: %u\nIncoming: %u\n",
statistics.good,
statistics.dubious,
statistics.cached,
statistics.incoming);
}
else if(strcmp(in, "/num_nodes") == 0)
printf("%u", NeoComm_count_connected_nodes());
else if(strcmp(in, "/help") == 0)