From 436f462cfa61a814ff4600b60e454ec080e6e840 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 10 Dec 2024 09:14:50 +1000 Subject: [PATCH] Fix next source piece index calculation --- crates/subspace-core-primitives/src/pieces.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/subspace-core-primitives/src/pieces.rs b/crates/subspace-core-primitives/src/pieces.rs index e22a9349d2..8db8b0f922 100644 --- a/crates/subspace-core-primitives/src/pieces.rs +++ b/crates/subspace-core-primitives/src/pieces.rs @@ -143,7 +143,7 @@ impl PieceIndex { /// Returns the next source piece index #[inline] pub const fn next_source_index(&self) -> PieceIndex { - PieceIndex(self.0.next_multiple_of(Self::source_ratio())) + PieceIndex(self.0 + Self::source_ratio() - (self.0 % Self::source_ratio())) } /// The ratio of source pieces to all pieces