Always return fully extended block in blocks API even if indexing is disabled
This commit is contained in:
		
							parent
							
								
									2b5442783e
								
							
						
					
					
						commit
						56dad33fce
					
				@ -609,7 +609,9 @@ class Blocks {
 | 
			
		||||
    const transactions = await this.$getTransactionsExtended(blockHash, block.height, true);
 | 
			
		||||
    const blockExtended = await this.$getBlockExtended(block, transactions);
 | 
			
		||||
 | 
			
		||||
    await blocksRepository.$saveBlockInDatabase(blockExtended);
 | 
			
		||||
    if (Common.indexingEnabled()) {
 | 
			
		||||
      await blocksRepository.$saveBlockInDatabase(blockExtended);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return prepareBlock(blockExtended);
 | 
			
		||||
  }
 | 
			
		||||
@ -713,7 +715,7 @@ class Blocks {
 | 
			
		||||
        block = await this.$indexBlock(currentHeight);
 | 
			
		||||
        returnBlocks.push(block);
 | 
			
		||||
      } else if (nextHash != null) {
 | 
			
		||||
        block = prepareBlock(await bitcoinClient.getBlock(nextHash));
 | 
			
		||||
        block = await this.$indexBlock(currentHeight);
 | 
			
		||||
        nextHash = block.previousblockhash;
 | 
			
		||||
        returnBlocks.push(block);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user