Skip to content

Commit

Permalink
gasPriceCapGwei fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elznr committed Mar 20, 2023
1 parent be971f3 commit a026d73
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function useRunner({

async function fetchAndProcess() {
if (gasPriceCap !== '' && gasPriceCap !== '0') {
gasPriceCapGwei = parseUnits(gasPriceCap, 'gwei');
gasPriceCapGwei = parseUnits(gasPriceCap + '', 'gwei');
}

if (gasPrice) {
Expand Down Expand Up @@ -222,11 +222,12 @@ export function useRunner({
}

if (
gasPriceCapGwei > parseUnits('0', 'gwei') &&
gasPriceGwei > gasPriceCapGwei
gasPriceCap !== '' &&
gasPriceCap !== '0' &&
gasPriceGwei.gte(gasPriceCapGwei)
) {
writeLog.info(
'Gas price is higher than gas price cap. Relaying is paused.'
'Gas price is higher than gas price cap. Relaying is paused. '
);

return;
Expand Down

0 comments on commit a026d73

Please sign in to comment.