aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.inl
diff options
context:
space:
mode:
authorrfree2monero <rfreemonero@op.pl>2015-04-01 19:00:45 +0200
committerrfree2monero <rfreemonero@op.pl>2015-04-01 19:00:45 +0200
commitc511abf0058b8c1d020255faaad418b0ffd2eb26 (patch)
tree26c4cd88d16e79d5dc59fb3bfc43d399fb2239a3 /src/cryptonote_protocol/cryptonote_protocol_handler.inl
parentMerge remote-tracking branch 'monero-official/master' into network-1.6-work1 (diff)
downloadmonero-c511abf0058b8c1d020255faaad418b0ffd2eb26.tar.xz
remerged; commands JSON. logging upgrade. doxygen
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 023dd03a6..1cf66521f 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -210,6 +210,42 @@ namespace cryptonote
cnx.live_time = timestamp - cntxt.m_started;
+ uint32_t ip;
+ ip = ntohl(cntxt.m_remote_ip);
+ if (ip == LOCALHOST_INT)
+ {
+ cnx.localhost = true;
+ }
+ else
+ {
+ cnx.localhost = false;
+ }
+
+ if (ip > 3232235520 && ip < 3232301055) // 192.168.x.x
+ {
+ cnx.local_ip = true;
+ }
+ else
+ {
+ cnx.local_ip = false;
+ }
+
+ auto connection_time = time(NULL) - cntxt.m_started;
+ if (connection_time == 0)
+ {
+ cnx.avg_download = 0;
+ cnx.avg_upload = 0;
+ }
+
+ else
+ {
+ cnx.avg_download = cntxt.m_recv_cnt / connection_time / 1024;
+ cnx.avg_upload = cntxt.m_send_cnt / connection_time / 1024;
+ }
+
+ cnx.current_download = cntxt.m_current_speed_down / 1024;
+ cnx.current_upload = cntxt.m_current_speed_up / 1024;
+
connections.push_back(cnx);
return true;
@@ -543,6 +579,7 @@ namespace cryptonote
LOG_PRINT_CCONTEXT_L2("Block process time: " << block_process_time + transactions_process_time << "(" << transactions_process_time << "/" << block_process_time << ")ms");
epee::net_utils::data_logger::get_instance().add_data("calc_time", block_process_time + transactions_process_time);
+ epee::net_utils::data_logger::get_instance().add_data("block_processing", 1);
} // each download block