Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyudmil Danailov authored and Lyudmil Danailov committed Nov 27, 2023
1 parent 3d6868d commit 59df0b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions blockchains/eth/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ const NODE_URL = process.env.NODE_URL || process.env.PARITY_URL || 'http://local
const LOOP_INTERVAL_CURRENT_MODE_SEC = parseInt(process.env.LOOP_INTERVAL_CURRENT_MODE_SEC || '30');

module.exports = {
IS_ETH,
NODE_URL,
MAX_RETRIES,
BURN_ADDRESS,
CONFIRMATIONS,
BLOCK_INTERVAL,
ETH_WITHDRAWAL,
LONDON_FORK_BLOCK,
SHANGHAI_FORK_BLOCK,
RECEIPTS_API_METHOD,
MAX_CONCURRENT_REQUESTS,
LOOP_INTERVAL_CURRENT_MODE_SEC
IS_ETH,
NODE_URL,
MAX_RETRIES,
BURN_ADDRESS,
CONFIRMATIONS,
BLOCK_INTERVAL,
ETH_WITHDRAWAL,
LONDON_FORK_BLOCK,
SHANGHAI_FORK_BLOCK,
RECEIPTS_API_METHOD,
MAX_CONCURRENT_REQUESTS,
LOOP_INTERVAL_CURRENT_MODE_SEC
};
4 changes: 2 additions & 2 deletions blockchains/eth/lib/next_interval_calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const constants = require('./constants');
/**
* A function that returns the appropriate array of intervals,
* depending on the progress that the worker's made.
* @param {BaseWorker} worker The worker instance.
* @param {BaseWorker} worker A worker instance, inherriting the BaseWorker class.
* @returns {Array} An array of intervals.
*/
async function nextIntervalCalculator(worker) {
Expand All @@ -17,7 +17,7 @@ async function nextIntervalCalculator(worker) {
}

worker.sleepTimeMsec = 0;
const progressDifference = this.lastConfirmedBlock - this.lastExportedBlock;
const progressDifference = worker.lastConfirmedBlock - worker.lastExportedBlock;
const maxInterval = constants.MAX_CONCURRENT_REQUESTS * constants.BLOCK_INTERVAL;
let intervalArrayLength;
if (progressDifference < maxInterval) {
Expand Down

0 comments on commit 59df0b0

Please sign in to comment.