Merge pull request #3043 from mempool/nymkappa/bugfix/blocks-api

Fixes blocks api (missing fee range)
This commit is contained in:
softsimon
2023-02-18 15:26:08 +07:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -610,7 +610,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);
}
@@ -714,7 +716,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);
}