aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-09 21:22:05 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-09 21:22:05 +0100
commit0e8d60c06c5c00c872d747a1b0383863ddb26443 (patch)
tree007cb17d099cddc730f7cbffe822e3ee8cb49096 /src/cryptonote_protocol
parentMerge pull request #2271 (diff)
downloadmonero-0e8d60c06c5c00c872d747a1b0383863ddb26443.tar.xz
cryptonote_protocol: fix recv/send idle time before handshake
Diffstat (limited to 'src/cryptonote_protocol')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 3e3bb83d0..d74937783 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -209,10 +209,10 @@ namespace cryptonote
cnx.support_flags = support_flags;
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_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);