From e74e6d2bca9394dfa12704796a53c1571a209faf Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 9 Jun 2007 02:05:46 +0000 Subject: [PATCH] fix to report proper seeds and peers --- src/deluge_core.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index b8314a9d3..99c5367da 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -613,10 +613,10 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args) long connected_seeds = 0; for (unsigned long i = 0; i < peers.size(); i++) - if (peers[i].flags&(peer_info::seed) && !(peers[i].flags&(peer_info::handshake|peer_info::connecting|peer_info::queued))) - connected_seeds++; - - long connected_peers = s.num_peers - connected_seeds; + if ((peers[i].flags&(peer_info::seed)) && !(peers[i].flags&(peer_info::handshake|peer_info::connecting|peer_info::queued))) + connected_seeds++; + + long connected_peers = peers.size() - connected_seeds; return Py_BuildValue("{s:s,s:i,s:i,s:l,s:l,s:f,s:f,s:f,s:L,s:L,s:b,s:s,s:s,s:f,s:L,s:L,s:l,s:i,s:i,s:L,s:L,s:i,s:l,s:l,s:b,s:b,s:L,s:L,s:L}", "name", t.handle.get_torrent_info().name().c_str(),