2009-12-06 05:12:51 PST
OK there's something wrong with the data in the database then because I've tried changing the code to:
int seeding_time = 0;
if (i != file.peers.end()
&& boost::equals(i->second.peer_id, v.m_peer_id)
&& v.m_left == 0
&& v.m_uploaded > i->second.uploaded
&& time() > i->second.mtime
&& i->second.mtime > 0)
{
seeding_time=(time() - i->second.mtime);
}
And there are still peers with **active** as 0 in the database but if they're getting updated then their uploaded totals have to be increasing. The only thing I can think of is the frontend's sanity check must have set the values to 0 and as XBT sets the value to it's current value then it never gets set it back to 1.
I think I will use your definition to make sure the active value is correct rather than setting it to it's current value as it does right now.
Thanks for your help, I think I can handle it from here.