@@ -289,27 +289,6 @@ drainLoop:
289289 return nil
290290}
291291
292- // isCatchingUpState returns true if the syncer has pending events or is behind the current raft height
293- func (s * Syncer ) isCatchingUpState () bool {
294- return len (s .heightInCh ) != 0 || func () bool {
295- currentHeight , err := s .store .Height (s .ctx )
296- if err != nil {
297- s .logger .Error ().Err (err ).Msg ("failed to get current height" )
298- return false
299- }
300- return s .headerStore .Store ().Height () > currentHeight ||
301- s .dataStore .Store ().Height () > currentHeight ||
302- s .raftRetriever != nil && s .raftRetriever .Height () > currentHeight
303- }()
304- }
305-
306- // GetLastState returns the current state.
307- func (e * Syncer ) GetLastState () types.State {
308- state := e .getLastState ()
309- state .AppHash = bytes .Clone (state .AppHash )
310- return state
311- }
312-
313292// getLastState returns the current state
314293func (s * Syncer ) getLastState () types.State {
315294 state := s .lastState .Load ()
@@ -1239,15 +1218,6 @@ func (s *Syncer) cancelP2PWait(height uint64) {
12391218 }
12401219}
12411220
1242- // IsSynced checks if the last block height in the stored state matches the expected height and returns true if they are equal.
1243- func (s * Syncer ) IsSynced (expHeight uint64 ) bool {
1244- state , err := s .store .GetState (s .ctx )
1245- if err != nil {
1246- return false
1247- }
1248- return state .LastBlockHeight == expHeight && ! s .isCatchingUpState ()
1249- }
1250-
12511221// IsSyncedWithRaft checks if the local state is synced with the given raft state, including hash check.
12521222func (s * Syncer ) IsSyncedWithRaft (raftState * raft.RaftBlockState ) (int , error ) {
12531223 state , err := s .store .GetState (s .ctx )
0 commit comments