4747 blockPrefix = byte (0x03 )
4848 isIncompletePrefix = byte (0x04 )
4949 previouslyIndexedPrefix = byte (0x05 )
50- hasRunKey = []byte {0x06 }
50+ hasRunKey = []byte {0x07 }
5151)
5252
5353var (
@@ -182,14 +182,6 @@ func (i *indexer) RegisterChain(name string, ctx *snow.Context, engine common.En
182182 return
183183 }
184184
185- if ! i .allowIncompleteIndex && isIncomplete && (previouslyIndexed || i .hasRunBefore ) {
186- i .log .Fatal ("index %s is incomplete but incomplete indices are disabled. Shutting down" , name )
187- if err := i .close (); err != nil {
188- i .log .Error ("error while closing indexer: %s" , err )
189- }
190- return
191- }
192-
193185 if ! i .indexingEnabled { // Indexing is disabled
194186 if previouslyIndexed && ! i .allowIncompleteIndex {
195187 // We indexed this chain in a previous run but not in this run.
@@ -213,6 +205,14 @@ func (i *indexer) RegisterChain(name string, ctx *snow.Context, engine common.En
213205 return
214206 }
215207
208+ if ! i .allowIncompleteIndex && isIncomplete && (previouslyIndexed || i .hasRunBefore ) {
209+ i .log .Fatal ("index %s is incomplete but incomplete indices are disabled. Shutting down" , name )
210+ if err := i .close (); err != nil {
211+ i .log .Error ("error while closing indexer: %s" , err )
212+ }
213+ return
214+ }
215+
216216 // Mark that in this run, this chain was indexed
217217 if err := i .markPreviouslyIndexed (chainID ); err != nil {
218218 i .log .Error ("couldn't mark chain %s as indexed: %s" , name , err )
0 commit comments