Wrap block indexing into a try/catch since we don't use async when calling that function

This commit is contained in:
nymkappa
2022-01-24 15:36:30 +09:00
parent f8f9108ae1
commit a271c39ba8

View File

@@ -150,6 +150,7 @@ class Blocks {
return;
}
try {
let currentBlockHeight = await bitcoinClient.getBlockCount();
const indexedBlockCount = await blocksRepository.$blockCount();
@@ -186,6 +187,9 @@ class Blocks {
currentBlockHeight -= chunkSize;
}
} catch (e) {
logger.err('An error occured in $generateBlockDatabase(). Skipping block indexing. ' + e);
}
}
public async $updateBlocks() {