From ef511bd89d907a38863d0a7757d0f2bf54e856eb Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Fri, 29 Dec 2023 22:49:14 +0800 Subject: [PATCH] fix: refresh last state even no proved state --- src/protocols/light_client/peers.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/protocols/light_client/peers.rs b/src/protocols/light_client/peers.rs index 7bc62aa..86b3674 100644 --- a/src/protocols/light_client/peers.rs +++ b/src/protocols/light_client/peers.rs @@ -1033,9 +1033,10 @@ impl PeerState { fn require_new_last_state(&self, before_ts: u64) -> bool { match self { Self::Initialized => true, - Self::Ready { ref last_state, .. } => last_state.update_ts() < before_ts, - Self::OnlyHasLastState { .. } - | Self::RequestFirstLastState { .. } + Self::OnlyHasLastState { ref last_state } | Self::Ready { ref last_state, .. } => { + last_state.update_ts() < before_ts + } + Self::RequestFirstLastState { .. } | Self::RequestFirstLastStateProof { .. } | Self::RequestNewLastState { .. } | Self::RequestNewLastStateProof { .. } => false,