mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Wrap block indexing into a try/catch since we don't use async when calling that function
This commit is contained in:
parent
f8f9108ae1
commit
a271c39ba8
1 changed files with 35 additions and 31 deletions
|
@ -150,6 +150,7 @@ class Blocks {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
let currentBlockHeight = await bitcoinClient.getBlockCount();
|
let currentBlockHeight = await bitcoinClient.getBlockCount();
|
||||||
const indexedBlockCount = await blocksRepository.$blockCount();
|
const indexedBlockCount = await blocksRepository.$blockCount();
|
||||||
|
|
||||||
|
@ -186,6 +187,9 @@ class Blocks {
|
||||||
|
|
||||||
currentBlockHeight -= chunkSize;
|
currentBlockHeight -= chunkSize;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
logger.err('An error occured in $generateBlockDatabase(). Skipping block indexing. ' + e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async $updateBlocks() {
|
public async $updateBlocks() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue