Skip to content

Commit

Permalink
Self review
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift committed Apr 1, 2024
1 parent 2c4ff6a commit fb1caf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gas-price/gas-price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const getRecommendedGasPrice = (chainId: string, providerName: string, sp
let latestGasPrice: bigint | undefined;
// Use the latest gas price that is stored in the state. We assume that the gas price is fetched frequently and has
// been fetched immediately before making this call. In case it fails, we fallback to the previously stored gas price.
if (!latestGasPrice && gasPrices.length > 0) {
if (gasPrices.length > 0) {
const lastSavedTimestamp = Math.max(...gasPrices.map((gasPrice) => gasPrice.timestamp));
latestGasPrice = gasPrices.find((gasPrice) => gasPrice.timestamp === lastSavedTimestamp)!.price;
}
Expand Down

0 comments on commit fb1caf6

Please sign in to comment.