File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -125,10 +125,6 @@ proc getPendingBlocks(
125125  # # Get pending blocks iterator
126126  # #
127127
128-   if  indices.len ==  0 :
129-     trace  " No indices to fetch blocks for" =  manifest.treeCid
130-     return  AsyncResultIter [(?! bt.Block , int )].empty ()
131- 
132128  var  pendingBlocks: seq [Future [(?! bt.Block , int )].Raising CancelledError ])] =  @ []
133129
134130  proc  attachIndex (
@@ -158,10 +154,8 @@ proc getPendingBlocks(
158154            $ index
159155        )
160156    except  ValueError  as  err:
161-       #  ValueError is raised by `one` when the pendingBlocks is empty -
162-       #  but we check for that at the very beginning - 
163-       #  thus, if this happens, we raise an assert
164-       raiseAssert (" fatal: pendingBlocks is empty - this should never happen" 
157+       #  ValueError is raised by `one` when the pendingBlocks is empty
158+       return  failure (" iterator finished (pendingBlocks empty) but genNext() was called" 
165159
166160  AsyncResultIter [(?! bt.Block , int )].new (genNext, isFinished)
167161
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments