runner time tick bugfix
This commit is contained in:
@@ -269,7 +269,6 @@ class BlockStateRunner:
|
|||||||
log.debug(f'block {block.hash} was already processed')
|
log.debug(f'block {block.hash} was already processed')
|
||||||
return
|
return
|
||||||
latest_block.set(block)
|
latest_block.set(block)
|
||||||
current_clock.get().set(block.timestamp)
|
|
||||||
if self.state is None:
|
if self.state is None:
|
||||||
# initialize
|
# initialize
|
||||||
self.state = BlockState(block)
|
self.state = BlockState(block)
|
||||||
@@ -383,19 +382,9 @@ class BlockStateRunner:
|
|||||||
session.close()
|
session.close()
|
||||||
|
|
||||||
|
|
||||||
async def handle_time_tick(self, blockhash):
|
async def handle_time_tick(self, block):
|
||||||
if current_blockstate.get() is None:
|
if current_blockstate.get() is None:
|
||||||
return
|
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)
|
fork = self.state.fork(block)
|
||||||
current_block.set(block)
|
current_block.set(block)
|
||||||
current_fork.set(fork)
|
current_fork.set(fork)
|
||||||
|
|||||||
Reference in New Issue
Block a user