Skip to content

Commit

Permalink
Improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift committed Apr 1, 2024
1 parent 0ba6fac commit 6273f33
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gas-price/gas-price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,19 @@ export const getRecommendedGasPrice = (chainId: string, providerName: string, sp
// Check if the next update is a retry of a pending transaction and if it has been pending longer than scalingWindow
if (lastUpdateTimestamp) {
const pendingPeriod = Math.floor(Date.now() / 1000) - lastUpdateTimestamp;
const multiplier = calculateScalingMultiplier(
const scalingMultiplier = calculateScalingMultiplier(
recommendedGasPriceMultiplier,
maxScalingMultiplier,
pendingPeriod,
scalingWindow
);

logger.warn('Scaling gas price.', { gasPrice: latestGasPrice.toString(), multiplier, pendingPeriod });
return multiplyBigNumber(latestGasPrice, multiplier);
logger.warn('Scaling gas price.', {
gasPrice: latestGasPrice.toString(),
multiplier: scalingMultiplier,
pendingPeriod,
});
return multiplyBigNumber(latestGasPrice, scalingMultiplier);
}

// Check that there are enough entries in the stored gas prices to determine whether to use sanitization or not
Expand Down

0 comments on commit 6273f33

Please sign in to comment.