Skip to content

How does libtorrent handle the hash check of pieces overlapping multiple files when a file is skipped? #7489

Answered by arvidn
mebeim asked this question in Q&A
Discussion options

You must be logged in to vote

the short answer is that libtorrent would download both files in order to validate the hash, but the unwanted file would be tucked-away in a part-file.

The slightly longer answer is that libtorrent only downloads at piece granularity. The more common case is that the only "unwanted" data that's downloaded is a partial piece at the start and end of the file set to be downloaded. These partial pieces are stored in the part-file. Keeping them around is important to be able to offer them to other peers that also want to download the file you downloaded. They will also need those "unwanted" parts in order to validated the piece hashes.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mebeim
Comment options

Answer selected by mebeim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants