runner time tick bugfix

This commit is contained in:
tim
2024-01-22 00:42:09 -04:00
parent 294b12d639
commit f052ecd30d

View File

@@ -269,7 +269,6 @@ class BlockStateRunner:
log.debug(f'block {block.hash} was already processed')
return
latest_block.set(block)
current_clock.get().set(block.timestamp)
if self.state is None:
# initialize
self.state = BlockState(block)
@@ -383,19 +382,9 @@ class BlockStateRunner:
session.close()
async def handle_time_tick(self, blockhash):
async def handle_time_tick(self, block):
if current_blockstate.get() is None:
return
try:
blockhash = blockhash['hash']
except TypeError:
pass
# similar to handle_head, but we only call the postprocess events, since there was only a time tick and no new block data
try:
block = self.state.by_hash[blockhash]
except KeyError:
log.warning(f'No block data for {blockhash}. Aborting time tick.')
return
fork = self.state.fork(block)
current_block.set(block)
current_fork.set(fork)