Timlord updates state immediately, prevents race condition (#1271)

This commit is contained in:
Mariano Sorgente
2021-03-13 10:03:05 -08:00
committed by GitHub
parent 0be31f7519
commit de6138583b
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ def _get_next_difficulty(
"""
next_height: uint32 = uint32(height + 1)
if next_height < constants.EPOCH_BLOCKS:
if next_height < (constants.EPOCH_BLOCKS - 3 * constants.MAX_SUB_SLOT_BLOCKS):
# We are in the first epoch
return uint64(constants.DIFFICULTY_STARTING)
+2
View File
@@ -706,6 +706,8 @@ class Timelord:
self.overflow_blocks = []
self.new_subslot_end = eos_bundle
await self._handle_subslot_end()
async def _handle_failures(self):
while len(self.vdf_failures) > 0:
log.error(f"Vdf clients failed {self.vdf_failures_count} times.")