From be27640ac6dcf2572a94091ef7b0e2af7d2ee772 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 17 Sep 2026 08:21:11 -0400 Subject: [PATCH] calculate peer activity based on interested and choked flags --- libi2pd_client/Torrents.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libi2pd_client/Torrents.h b/libi2pd_client/Torrents.h index edeaea34..538aa062 100644 --- a/libi2pd_client/Torrents.h +++ b/libi2pd_client/Torrents.h @@ -333,8 +333,8 @@ namespace torrents void ResetStats (); uint64_t GetDownloadRate () const { return m_DownloadRate; } uint64_t GetUploadRate () const { return m_UploadRate; } - bool IsDownloading () const { return m_NumRequests > 0; } - bool IsUploading () const { return m_NumPieces > 0 || (m_Stream && m_Stream->GetSendBufferSize () > 4); } + bool IsDownloading () const { return m_IsInterested && !m_IsChoked; } + bool IsUploading () const { return m_IsRemoteInterested && !m_IsRemoteChoked; } bool IsInterested () const { return m_IsInterested; } bool IsRemoteInterested () const { return m_IsRemoteInterested; } bool IsChoked () const { return m_IsChoked; }