Skip to content

Commit

Permalink
fix: refresh last state even no proved state
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Dec 29, 2023
1 parent 86865db commit f3d4bd1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/protocols/light_client/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,9 +1025,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,
Expand Down

0 comments on commit f3d4bd1

Please sign in to comment.