diff --git a/codex/erasure/erasure.nim b/codex/erasure/erasure.nim index 01401f2b..01ec29cf 100644 --- a/codex/erasure/erasure.nim +++ b/codex/erasure/erasure.nim @@ -200,7 +200,9 @@ proc decode*( resolved = 0 while true: - if resolved >= (encoded.K + encoded.M) or idxPendingBlocks.len <= 0: + # Continue to receive blocks until we have just enough for decoding + # or no more blocks can arrive + if (resolved >= encoded.K) or (idxPendingBlocks.len == 0): break let