Fixes issue where ecK was used as numberOfSlots.

This commit is contained in:
benbierens 2023-12-12 15:20:26 +01:00 committed by Dmitriy Ryajov
parent 4bdf0dfd33
commit c0f4512f62
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
2 changed files with 7 additions and 1 deletions

View File

@ -98,6 +98,12 @@ proc verificationRoot*(self: Manifest): Cid =
proc slotRoots*(self: Manifest): seq[Cid] =
self.slotRoots
proc numberOfSlots*(self: Manifest): int =
if not self.protected:
0
else:
self.ecK + self.ecM
############################################################
# Operations on block list
############################################################

View File

@ -51,7 +51,7 @@ proc selectSlotBlocks*(self: SlotBuilder, datasetSlotIndex: int): Future[?!seq[C
let
datasetTreeCid = self.manifest.treeCid
blockCount = self.manifest.blocksCount
numberOfSlots = self.manifest.ecK
numberOfSlots = self.manifest.numberOfSlots
strategy = SteppedIndexingStrategy.new(0, blockCount - 1, numberOfSlots)
for datasetBlockIndex in strategy.getIndicies(datasetSlotIndex):