1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 07:42:37 +00:00

fix: update torrent progress when verifying partially completed pieces (#7143)

* fix: update torrent progress when verifying partially completed pieces

* chore: restrict scope of local variable
This commit is contained in:
Yat Ho 2024-10-14 08:15:21 +08:00 committed by GitHub
parent f5997eb5ed
commit 61ecad4c43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1699,9 +1699,7 @@ void tr_torrent::VerifyMediator::on_verify_started()
void tr_torrent::VerifyMediator::on_piece_checked(tr_piece_index_t const piece, bool const has_piece)
{
auto const had_piece = tor_->has_piece(piece);
if (has_piece != had_piece)
if (auto const had_piece = tor_->has_piece(piece); !has_piece || !had_piece)
{
tor_->set_has_piece(piece, has_piece);
tor_->set_dirty();