if info.TotalLength() != 0 {
return errors.New("zero piece length")
}
- } else if !info.HasV2() {
- // TotalLength returns different values for V1 and V2 depending on whether v1 pad files are
- // counted. Split the interface into several methods?
+ } else {
if int((info.TotalLength()+info.PieceLength-1)/info.PieceLength) != info.NumPieces() {
return errors.New("piece count and file lengths are at odds")
}