peer.have was being initialized to the block count, rather than the piece count, resulting in wasted overhead.
This commit is contained in:
parent
0c4fe00658
commit
bf6c2a0df7
|
@ -401,7 +401,7 @@ getPeer( Torrent * torrent, struct peer_atom * atom )
|
||||||
if( peer == NULL )
|
if( peer == NULL )
|
||||||
{
|
{
|
||||||
peer = peerNew( atom );
|
peer = peerNew( atom );
|
||||||
tr_bitfieldConstruct( &peer->have, torrent->tor->blockCount );
|
tr_bitfieldConstruct( &peer->have, torrent->tor->info.pieceCount );
|
||||||
tr_bitfieldConstruct( &peer->blame, torrent->tor->blockCount );
|
tr_bitfieldConstruct( &peer->blame, torrent->tor->blockCount );
|
||||||
tr_ptrArrayInsertSorted( &torrent->peers, peer, peerCompare );
|
tr_ptrArrayInsertSorted( &torrent->peers, peer, peerCompare );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue