Works fine now finally

This commit is contained in:
Igor Katson 2024-04-24 22:21:41 +01:00
parent 7e180c05b3
commit f0788f2c4a
4 changed files with 121 additions and 35 deletions

View file

@ -194,6 +194,14 @@ impl ChunkTracker {
.filter_map(|id| self.lengths.validate_piece_index(id))
}
pub(crate) fn is_piece_queued(&self, id: ValidPieceIndex) -> bool {
self.queue_pieces[id.get() as usize]
}
pub(crate) fn is_piece_have(&self, id: ValidPieceIndex) -> bool {
self.have[id.get() as usize]
}
// None if wrong chunk
// true if did something
// false if didn't do anything