aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-08-15 20:51:50 +0200
committerRiccardo Spagni <ric@spagni.net>2017-08-15 20:51:50 +0200
commit1d093eff67f0e5dc919f35ec42fa09c6d387a67e (patch)
treecb78eab4bac86f5f8684bb33812d3d9ff1d4665b /src
parentMerge pull request #2272 (diff)
parentcryptonote_protocol: fix recv/send idle time before handshake (diff)
downloadmonero-1d093eff67f0e5dc919f35ec42fa09c6d387a67e.tar.xz
Merge pull request #2273
0e8d60c0 cryptonote_protocol: fix recv/send idle time before handshake (moneromooo-monero)
Diffstat (limited to 'src')
-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 48ba963f2..06a5356fe 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);