diff options
Diffstat (limited to 'trackerlogic.c')
-rw-r--r-- | trackerlogic.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/trackerlogic.c b/trackerlogic.c index 3b83b77..18e8cf5 100644 --- a/trackerlogic.c +++ b/trackerlogic.c | |||
@@ -221,6 +221,10 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer ) { | |||
221 | } else | 221 | } else |
222 | clean_peerlist( NOW, torrent->peer_list ); | 222 | clean_peerlist( NOW, torrent->peer_list ); |
223 | 223 | ||
224 | /* Sanitize flags: Whoever claims to have completed download, must be a seeder */ | ||
225 | if( ( OT_FLAG( peer ) & ( PEER_FLAG_COMPLETED | PEER_FLAG_SEEDING ) ) == PEER_FLAG_COMPLETED ) | ||
226 | OT_FLAG( peer ) ^= PEER_FLAG_COMPLETED; | ||
227 | |||
224 | peer_pool = &torrent->peer_list->peers[0]; | 228 | peer_pool = &torrent->peer_list->peers[0]; |
225 | peer_dest = vector_find_or_insert( peer_pool, (void*)peer, sizeof( ot_peer ), OT_PEER_COMPARE_SIZE, &exactmatch ); | 229 | peer_dest = vector_find_or_insert( peer_pool, (void*)peer, sizeof( ot_peer ), OT_PEER_COMPARE_SIZE, &exactmatch ); |
226 | 230 | ||