Skip to content

Commit

Permalink
fix: treasury watch events
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Jan 19, 2022
1 parent dc91196 commit 14a39f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions yearn/treasury/treasury.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,13 @@ def watch_transfers(self):
logger.info(
'pulling treasury transfer events, please wait patiently this takes a while...'
)
transfer_filters = [
web3.eth.filter({"fromBlock": self._start_block, "topics": topics})
for topics in self._topics
]
for block in chain.new_blocks(height_buffer=12):
for topics in self._topics:
topic_filter = web3.eth.filter({"fromBlock": self._start_block, "topics": topics})
logs = topic_filter.get_new_entries()
for transfer_filter in transfer_filters:
logs = transfer_filter.get_new_entries()
self.process_transfers(logs)

if not self._done.is_set():
Expand Down

0 comments on commit 14a39f0

Please sign in to comment.