cryptonote_protocol: fix recv/send idle time before handshake

This commit is contained in:
moneromooo-monero 2017-08-09 21:22:05 +01:00
parent 181a008aa3
commit 0e8d60c06c
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

View File

@ -209,10 +209,10 @@ namespace cryptonote
cnx.support_flags = support_flags; cnx.support_flags = support_flags;
cnx.recv_count = cntxt.m_recv_cnt; cnx.recv_count = cntxt.m_recv_cnt;
cnx.recv_idle_time = timestamp - cntxt.m_last_recv; cnx.recv_idle_time = timestamp - std::max(cntxt.m_started, cntxt.m_last_recv);
cnx.send_count = cntxt.m_send_cnt; cnx.send_count = cntxt.m_send_cnt;
cnx.send_idle_time = timestamp - cntxt.m_last_send; cnx.send_idle_time = timestamp - std::max(cntxt.m_started, cntxt.m_last_send);
cnx.state = get_protocol_state_string(cntxt.m_state); cnx.state = get_protocol_state_string(cntxt.m_state);