From 25558b36c80782a4af614760bb57c34bda7bcdd9 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Mon, 11 Sep 2023 20:32:08 -0400 Subject: [PATCH] fix: update Status ForkId on new head (#4560) --- crates/net/network/src/session/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/net/network/src/session/mod.rs b/crates/net/network/src/session/mod.rs index f97a5cbfc..04d3ffe1d 100644 --- a/crates/net/network/src/session/mod.rs +++ b/crates/net/network/src/session/mod.rs @@ -176,12 +176,14 @@ impl SessionManager { /// Invoked on a received status update. /// - /// If the updated activated another fork, this will return a [`ForkTransition`] and updates the - /// active [`ForkId`](ForkId). See also [`ForkFilter::set_head`]. + /// If the updated activated another fork, this will return a [ForkTransition] and updates the + /// active [ForkId]. See also [ForkFilter::set_head]. pub(crate) fn on_status_update(&mut self, head: Head) -> Option { self.status.blockhash = head.hash; self.status.total_difficulty = head.total_difficulty; - self.fork_filter.set_head(head) + let transition = self.fork_filter.set_head(head); + self.status.forkid = self.fork_filter.current(); + transition } /// An incoming TCP connection was received. This starts the authentication process to turn this