Skip to content

Commit

Permalink
Merge pull request #172 from yangby-cryptape/bugfix/refresh-last-stat…
Browse files Browse the repository at this point in the history
…e-even-no-proved-state

fix: refresh last state even no proved state
  • Loading branch information
quake authored Dec 30, 2023
2 parents be21607 + ef511bd commit b95148c
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 @@ -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,
Expand Down

0 comments on commit b95148c

Please sign in to comment.