Merge pull request #106 from ikatson/resilience-to-bogus-peers

Fix resilience to bogus peers
This commit is contained in:
Igor Katson 2024-03-29 20:46:37 +00:00 committed by GitHub
commit bb0f3c36ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 8 deletions

View file

@ -25,9 +25,15 @@ pub struct PieceInfo {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ChunkInfo {
pub piece_index: ValidPieceIndex,
// Index of chunk within the piece.
pub chunk_index: u32,
// Absolute chunk index if the first chunk of the first piece was 0.
pub absolute_index: u32,
pub size: u32,
// Offset of chunk in bytes within the piece.
pub offset: u32,
}