mirror of
https://github.com/mempool/mempool.git
synced 2025-03-15 12:20:28 +01:00
parent
dec8ae2930
commit
8fbd273733
1 changed files with 5 additions and 3 deletions
|
@ -11,6 +11,7 @@ class Bisq {
|
||||||
private static BLOCKS_JSON_FILE_PATH = config.BISQ.DATA_PATH + '/json/all/blocks.json';
|
private static BLOCKS_JSON_FILE_PATH = config.BISQ.DATA_PATH + '/json/all/blocks.json';
|
||||||
private latestBlockHeight = 0;
|
private latestBlockHeight = 0;
|
||||||
private blocks: BisqBlock[] = [];
|
private blocks: BisqBlock[] = [];
|
||||||
|
private allBlocks: BisqBlock[] = [];
|
||||||
private transactions: BisqTransaction[] = [];
|
private transactions: BisqTransaction[] = [];
|
||||||
private transactionIndex: { [txId: string]: BisqTransaction } = {};
|
private transactionIndex: { [txId: string]: BisqTransaction } = {};
|
||||||
private blockIndex: { [hash: string]: BisqBlock } = {};
|
private blockIndex: { [hash: string]: BisqBlock } = {};
|
||||||
|
@ -171,7 +172,7 @@ class Bisq {
|
||||||
this.transactionIndex = {};
|
this.transactionIndex = {};
|
||||||
this.addressIndex = {};
|
this.addressIndex = {};
|
||||||
|
|
||||||
this.blocks.forEach((block) => {
|
this.allBlocks.forEach((block) => {
|
||||||
/* Build block index */
|
/* Build block index */
|
||||||
if (!this.blockIndex[block.hash]) {
|
if (!this.blockIndex[block.hash]) {
|
||||||
this.blockIndex[block.hash] = block;
|
this.blockIndex[block.hash] = block;
|
||||||
|
@ -245,8 +246,9 @@ class Bisq {
|
||||||
if (cacheData && cacheData.length !== 0) {
|
if (cacheData && cacheData.length !== 0) {
|
||||||
logger.debug('Processing Bisq data dump...');
|
logger.debug('Processing Bisq data dump...');
|
||||||
const data: BisqBlocks = await this.jsonParsePool.exec(cacheData);
|
const data: BisqBlocks = await this.jsonParsePool.exec(cacheData);
|
||||||
if (data.blocks && data.blocks.length !== this.blocks.length) {
|
if (data.blocks && data.blocks.length !== this.allBlocks.length) {
|
||||||
this.blocks = data.blocks.filter((block) => block.txs.length > 0);
|
this.allBlocks = data.blocks;
|
||||||
|
this.blocks = this.allBlocks.filter((block) => block.txs.length > 0);
|
||||||
this.blocks.reverse();
|
this.blocks.reverse();
|
||||||
this.latestBlockHeight = data.chainHeight;
|
this.latestBlockHeight = data.chainHeight;
|
||||||
const time = new Date().getTime() - start;
|
const time = new Date().getTime() - start;
|
||||||
|
|
Loading…
Add table
Reference in a new issue