Skip to content

Commit

Permalink
if the base fee of the prev block is 0, fallback to gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
borislav-itskov committed Oct 4, 2024
1 parent be7764f commit 9affe45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libs/gasPrice/gasPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ export async function getGasPriceRecommendations(
// https://github.com/ethers-io/ethers.js/issues/3683#issuecomment-1436554995
const txns = lastBlock.prefetchedTransactions

if (network.feeOptions.is1559 && lastBlock.baseFeePerGas != null) {
if (
network.feeOptions.is1559 &&
lastBlock.baseFeePerGas != null &&
lastBlock.baseFeePerGas !== 0n
) {
// https://eips.ethereum.org/EIPS/eip-1559
const elasticityMultiplier =
network.feeOptions.elasticityMultiplier ?? DEFAULT_ELASTICITY_MULTIPLIER
Expand Down

0 comments on commit 9affe45

Please sign in to comment.