Please provide the following information
libtorrent version (or branch):
RC_1_1 (commit 1bef80c3fa6aa0d91e33fc48d4a89c1c6181f286) though not limited to just this commit.
platform/architecture:
Win/x64 Python/x86
compiler and compiler version:
Boost 1.63 MSVC9.0 Python 2.7.12
please describe what symptom you see, what you would expect to see instead and
how to reproduce it.
I see negative peers connected (ex. -10(200)) (http://dev.deluge-torrent.org/attachment/ticket/2915/deluge%20negative%20peers.jpg).
Expected is non-negative numbers and to reproduce start any download in deluge-dev branch which is/should be 1.x compatible. Though any client that uses num_peers python binding should have same result. I will note though that it doesn't always show negative numbers it changes as connections are made/closed.
what are the actual fields used to display the peer count? I imagine it's something like:
torrent_status::num_peers and torrent_status::num_seeds. Is it possible that the number that's negative is the number of downloaders? i.e. num_peers - num_seeds?
If so, the error is that libtorrent says there are more seeds than there are peers.
Yes that does seem to be the case. https://github.com/deluge-torrent/deluge/blob/6b49f844dcca8a4af2461d8380a99c03a6d9e00a/deluge/core/torrent.py#L972
I believe this patch fixes it. against RC_1_1. Please confirm if you have a chance.
While i think my testing is fairly limited I believe this has fixed it. In observing several downloads i havn't seen this issue reoccur.
Most helpful comment
I believe this patch fixes it. against RC_1_1. Please confirm if you have a chance.
https://github.com/arvidn/libtorrent/pull/1645