Skip to content

Commit

Permalink
return empty list when no blocks mined
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjw committed Feb 23, 2019
1 parent dfeaac6 commit 4fb4d01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web3/middleware/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ def get_filter_changes(self):
@to_list
def block_hashes_in_range(w3, block_range):
from_block, to_block = block_range
if from_block is None or to_block is None:
return None
for block_number in range(from_block, to_block + 1):
yield getattr(w3.eth.getBlock(block_number), 'hash', None)

Expand Down

0 comments on commit 4fb4d01

Please sign in to comment.