capitalisk-dex 17.2.1 → 17.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +18 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2036,10 +2036,27 @@ module.exports = class CapitaliskDEXModule {
|
|
|
2036
2036
|
let currentBlock = await this._getBlockAtHeight(chainSymbol, fromHeight);
|
|
2037
2037
|
|
|
2038
2038
|
while (currentBlock) {
|
|
2039
|
-
let blocksToProcess = await this._getBlocksBetweenHeights(chainSymbol, currentBlock.height, toHeight, readMaxBlocks, false);
|
|
2040
2039
|
this.logger.info(
|
|
2041
2040
|
`Chain ${chainSymbol}: Processing blocks between heights ${currentBlock.height} and ${toHeight} as part of dividend calculation`
|
|
2042
2041
|
);
|
|
2042
|
+
let blocksToProcess;
|
|
2043
|
+
try {
|
|
2044
|
+
blocksToProcess = await this._getBlocksBetweenHeights(chainSymbol, currentBlock.height, toHeight, readMaxBlocks, false);
|
|
2045
|
+
} catch (error) {
|
|
2046
|
+
this.logger.error(
|
|
2047
|
+
`Chain ${
|
|
2048
|
+
chainSymbol
|
|
2049
|
+
}: Failed to fetch blocks between heights ${
|
|
2050
|
+
currentBlock.height
|
|
2051
|
+
} and ${
|
|
2052
|
+
toHeight
|
|
2053
|
+
} during dividend calculation because of error: ${
|
|
2054
|
+
error.message
|
|
2055
|
+
}`
|
|
2056
|
+
);
|
|
2057
|
+
await wait(this.options.readBlocksInterval);
|
|
2058
|
+
continue;
|
|
2059
|
+
}
|
|
2043
2060
|
for (let block of blocksToProcess) {
|
|
2044
2061
|
if (block.numberOfTransactions === 0) {
|
|
2045
2062
|
continue;
|