fix forkchoice for handling new blocks

This commit is contained in:
Youngjoon Lee 2025-05-12 16:29:43 +09:00
parent 9035ce4bcc
commit f99550475f
No known key found for this signature in database
GPG Key ID: 2B1315EF53B6DCA2

View File

@ -48,7 +48,7 @@ class Node:
if block.height <= self.tree.latest_immutable_block().height:
continue
# Switch (reset) to BOOTSTRAP fork choice if the node has fallen behind too much.
if max_peer_tip.height - self.tree.tip().height >= K:
if block.height - self.tree.tip().height >= K:
self.tree.fork_choice = ForkChoice(ForkChoiceRule.BOOTSTRAP)
self.download_blocks(peer, block.id)