Remove unescessary data from the blocks-bulk API
This commit is contained in:
parent
73f76474dd
commit
8612dd2d73
@ -783,10 +783,18 @@ class Blocks {
|
||||
const blocks: any[] = [];
|
||||
|
||||
while (fromHeight <= toHeight) {
|
||||
let block = await blocksRepository.$getBlockByHeight(fromHeight);
|
||||
let block: any = await blocksRepository.$getBlockByHeight(fromHeight);
|
||||
if (!block) {
|
||||
block = await this.$indexBlock(fromHeight);
|
||||
}
|
||||
|
||||
delete(block.hash);
|
||||
delete(block.previous_block_hash);
|
||||
delete(block.pool_name);
|
||||
delete(block.pool_link);
|
||||
delete(block.pool_addresses);
|
||||
delete(block.pool_regexes);
|
||||
|
||||
blocks.push(block);
|
||||
fromHeight++;
|
||||
}
|
||||
|
@ -384,6 +384,7 @@ class BlocksRepository {
|
||||
}
|
||||
|
||||
rows[0].fee_span = JSON.parse(rows[0].fee_span);
|
||||
rows[0].fee_percentiles = JSON.parse(rows[0].fee_percentiles);
|
||||
return rows[0];
|
||||
} catch (e) {
|
||||
logger.err(`Cannot get indexed block ${height}. Reason: ` + (e instanceof Error ? e.message : e));
|
||||
|
Loading…
x
Reference in New Issue
Block a user