mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-24 21:44:17 +00:00
// validate with smaller size to account uncertanty in network received bitfield
This commit is contained in:
parent
cefb94e321
commit
4cd345bf62
@ -1801,7 +1801,8 @@ namespace libtorrent
|
|||||||
bits.size() != t->torrent_file().num_pieces() )
|
bits.size() != t->torrent_file().num_pieces() )
|
||||||
{
|
{
|
||||||
if( bits.size() > t->torrent_file().num_pieces() ) {
|
if( bits.size() > t->torrent_file().num_pieces() ) {
|
||||||
if(validatePostNumberForUser(t->name(), bits.size())) {
|
// validate with smaller size to account uncertanty in network received bitfield
|
||||||
|
if(validatePostNumberForUser(t->name(), bits.size()-7)) {
|
||||||
t->increase_num_pieces(bits.size());
|
t->increase_num_pieces(bits.size());
|
||||||
} else {
|
} else {
|
||||||
disconnect(errors::invalid_bitfield_size, 2);
|
disconnect(errors::invalid_bitfield_size, 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user