diff --git a/src/controllers/blocks/BlocksController.ts b/src/controllers/blocks/BlocksController.ts index 0b85a13cf..b8fce71f8 100644 --- a/src/controllers/blocks/BlocksController.ts +++ b/src/controllers/blocks/BlocksController.ts @@ -191,11 +191,9 @@ export default class BlocksController extends AbstractController // HistoricApi to fetch any historic information that doesnt include the current runtime const historicApi = await this.api.at(hash); - console.time('BLOCK'); - const block = await this.service.fetchBlock(hash, historicApi, options); - console.timeEnd('BLOCK'); + // We set the last param to true because we haven't queried the finalizedHead - BlocksController.sanitizedSend(res, block); + BlocksController.sanitizedSend(res, await this.service.fetchBlock(hash, historicApi, options)); }; /** diff --git a/src/services/blocks/BlocksService.ts b/src/services/blocks/BlocksService.ts index e73b2082c..d9714b0f2 100644 --- a/src/services/blocks/BlocksService.ts +++ b/src/services/blocks/BlocksService.ts @@ -173,6 +173,9 @@ export class BlocksService extends AbstractService { } const previousBlockHash = await this.fetchPreviousBlockHash(number); + /** + * Fee calculation logic. This runs the the extrinsics concurrently. + */ const pQueue = new PromiseQueue(4); const feeTasks = []; for (let idx = 0; idx < block.extrinsics.length; ++idx) {