Fix Goggles indexing when summaries disabled
This commit is contained in:
		
							parent
							
								
									7405cf8336
								
							
						
					
					
						commit
						82920f621f
					
				@ -566,7 +566,7 @@ class Blocks {
 | 
			
		||||
   */
 | 
			
		||||
  public async $classifyBlocks(): Promise<void> {
 | 
			
		||||
    // classification requires an esplora backend
 | 
			
		||||
    if (config.MEMPOOL.BACKEND !== 'esplora') {
 | 
			
		||||
    if (!Common.blocksSummariesIndexingEnabled() || config.MEMPOOL.BACKEND !== 'esplora') {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -577,7 +577,7 @@ class Blocks {
 | 
			
		||||
    const unclassifiedTemplatesList = await BlocksSummariesRepository.$getTemplatesWithVersion(0);
 | 
			
		||||
 | 
			
		||||
    // nothing to do
 | 
			
		||||
    if (!unclassifiedBlocksList.length && !unclassifiedTemplatesList.length) {
 | 
			
		||||
    if (!unclassifiedBlocksList?.length && !unclassifiedTemplatesList?.length) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -586,8 +586,8 @@ class Blocks {
 | 
			
		||||
    let indexedTotal = 0;
 | 
			
		||||
 | 
			
		||||
    const minHeight = Math.min(
 | 
			
		||||
      unclassifiedBlocksList[unclassifiedBlocksList.length - 1].height ?? Infinity,
 | 
			
		||||
      unclassifiedTemplatesList[unclassifiedTemplatesList.length - 1].height ?? Infinity,
 | 
			
		||||
      unclassifiedBlocksList[unclassifiedBlocksList.length - 1]?.height ?? Infinity,
 | 
			
		||||
      unclassifiedTemplatesList[unclassifiedTemplatesList.length - 1]?.height ?? Infinity,
 | 
			
		||||
    );
 | 
			
		||||
    const numToIndex = Math.max(
 | 
			
		||||
      unclassifiedBlocksList.length,
 | 
			
		||||
 | 
			
		||||
@ -559,7 +559,7 @@ class DatabaseMigration {
 | 
			
		||||
      await this.updateToSchemaVersion(66);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (databaseSchemaVersion < 67) {
 | 
			
		||||
    if (databaseSchemaVersion < 67  && isBitcoin === true) {
 | 
			
		||||
      await this.$executeQuery('ALTER TABLE `blocks_summaries` ADD version INT NOT NULL DEFAULT 0');
 | 
			
		||||
      await this.$executeQuery('ALTER TABLE `blocks_summaries` ADD INDEX `version` (`version`)');
 | 
			
		||||
      await this.$executeQuery('ALTER TABLE `blocks_templates` ADD version INT NOT NULL DEFAULT 0');
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user