From f99550475ffcac1ee79ce25499fcdd621857585d Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Mon, 12 May 2025 16:29:43 +0900 Subject: [PATCH] fix forkchoice for handling new blocks --- cryptarchia/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptarchia/bootstrap.py b/cryptarchia/bootstrap.py index 6f0626c..83d6c32 100644 --- a/cryptarchia/bootstrap.py +++ b/cryptarchia/bootstrap.py @@ -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)