1 diff --git a/src/protocol/peer_connection_base.cc b/src/protocol/peer_connection_base.cc
2 index 9eddbb8..7985ad2 100644
3 --- a/src/protocol/peer_connection_base.cc
4 +++ b/src/protocol/peer_connection_base.cc
5 @@ -410,6 +410,8 @@ PeerConnectionBase::down_chunk() {
9 + m_peerInfo->set_last_transfer_down(cachedTime.seconds());
11 uint32_t bytesTransfered = 0;
12 BlockTransfer* transfer = m_downloadQueue.transfer();
14 @@ -642,6 +644,8 @@ PeerConnectionBase::up_chunk() {
18 + m_peerInfo->set_last_transfer_up(cachedTime.seconds());
20 uint32_t bytesTransfered = 0;
23 diff --git a/src/torrent/peer/peer_info.cc b/src/torrent/peer/peer_info.cc
24 index 06f9ae8..6bd1db0 100644
25 --- a/src/torrent/peer/peer_info.cc
26 +++ b/src/torrent/peer/peer_info.cc
27 @@ -54,6 +54,8 @@ PeerInfo::PeerInfo(const sockaddr* address) :
31 + m_lastTransferUp(0),
32 + m_lastTransferDown(0),
36 diff --git a/src/torrent/peer/peer_info.h b/src/torrent/peer/peer_info.h
37 index 5a6fe22..584ce86 100644
38 --- a/src/torrent/peer/peer_info.h
39 +++ b/src/torrent/peer/peer_info.h
40 @@ -100,6 +100,12 @@ public:
41 uint32_t last_connection() const { return m_lastConnection; }
42 void set_last_connection(uint32_t tvsec) { m_lastConnection = tvsec; }
44 + uint32_t last_transfer_up() const { return m_lastTransferUp; }
45 + uint32_t last_transfer_down() const { return m_lastTransferDown; }
46 + uint32_t last_transfer() const { return std::max(m_lastTransferUp, m_lastTransferDown); }
47 + void set_last_transfer_up(uint32_t tvsec) { m_lastTransferUp = tvsec; }
48 + void set_last_transfer_down(uint32_t tvsec){ m_lastTransferDown = tvsec; }
50 uint32_t last_handshake() const { return m_lastHandshake; }
51 void set_last_handshake(uint32_t tvsec) { m_lastHandshake = tvsec; }
53 @@ -137,6 +143,8 @@ private:
54 uint32_t m_failedCounter;
55 uint32_t m_transferCounter;
56 uint32_t m_lastConnection;
57 + uint32_t m_lastTransferUp;
58 + uint32_t m_lastTransferDown;
59 uint32_t m_lastHandshake;
61 uint16_t m_listenPort;