@@ -259,64 +259,13 @@ impl ChainState {
259259 Self :: default ( )
260260 }
261261
262- /// Whether the chain was synced from a checkpoint rather than genesis.
263- pub fn synced_from_checkpoint ( & self ) -> bool {
264- self . sync_base_height > 0
265- }
266-
267- /// Update chain lock status
268- pub fn update_chain_lock ( & mut self , height : u32 , hash : BlockHash ) {
269- // Only update if this is a newer chain lock
270- if self . last_chainlock_height . is_none_or ( |h| height > h) {
271- self . last_chainlock_height = Some ( height) ;
272- self . last_chainlock_hash = Some ( hash) ;
273- }
274- }
275-
276- /// Check if a block at given height is chain-locked
277- pub fn is_height_chain_locked ( & self , height : u32 ) -> bool {
278- self . last_chainlock_height . is_some_and ( |locked_height| height <= locked_height)
279- }
280-
281- /// Check if we have a chain lock
282- pub fn has_chain_lock ( & self ) -> bool {
283- self . last_chainlock_height . is_some ( )
284- }
285-
286- /// Get the last chain-locked height
287- pub fn get_last_chainlock_height ( & self ) -> Option < u32 > {
288- self . last_chainlock_height
289- }
290-
291- /// Get filter matched heights (placeholder for now)
292- /// In a real implementation, this would track heights where filters matched wallet transactions
293- pub fn get_filter_matched_heights ( & self ) -> Option < Vec < u32 > > {
294- // For now, return an empty vector as we don't track this yet
295- // This would typically be populated during filter sync when matches are found
296- Some ( Vec :: new ( ) )
297- }
298-
299262 /// Initialize chain state from a checkpoint.
300263 pub fn init_from_checkpoint ( & mut self , checkpoint_height : u32 ) {
301264 // Set sync base height to checkpoint
302265 self . sync_base_height = checkpoint_height;
303266
304267 tracing:: info!( "Initialized ChainState from checkpoint - height: {}" , checkpoint_height) ;
305268 }
306-
307- /// Get the absolute height for a given index in our headers vector.
308- pub fn index_to_height ( & self , index : usize ) -> u32 {
309- self . sync_base_height + index as u32
310- }
311-
312- /// Get the index in our headers vector for a given absolute height.
313- pub fn height_to_index ( & self , height : u32 ) -> Option < usize > {
314- if height < self . sync_base_height {
315- None
316- } else {
317- Some ( ( height - self . sync_base_height ) as usize )
318- }
319- }
320269}
321270
322271impl std:: fmt:: Debug for ChainState {
0 commit comments