diff --git a/metrics/src/gas.py b/metrics/src/gas.py index 72e918c..ab3c5b7 100644 --- a/metrics/src/gas.py +++ b/metrics/src/gas.py @@ -39,6 +39,9 @@ def calc_avg_gas_price(): logger.info(f'Getting historic block gas prices...') for index in range(GAS_ESTIMATION_ITERATIONS): block_number = block_number - BLOCK_SAMPLING * index + if block_number < 0: + break + logger.info(f'Getting block {block_number}...') block = w3.eth.get_block(block_number) total_gas_used += block['baseFeePerGas']