@@ -6,7 +6,7 @@ use std::{
66 sync:: { Arc , Mutex } ,
77} ;
88
9- use cardano_blockchain_types:: { MultiEraBlock , Network , Point } ;
9+ use cardano_blockchain_types:: { Fork , MultiEraBlock , Network , Point } ;
1010use logcall:: logcall;
1111use tokio:: task;
1212use tracing:: { debug, error} ;
@@ -52,12 +52,14 @@ pub(crate) struct MithrilSnapshotIterator {
5252
5353/// Create a probe point used in iterations to find the start when its not exactly known.
5454pub ( crate ) fn probe_point ( point : & Point , distance : u64 ) -> Point {
55+ /// Step back point to indicate origin.
56+ const STEP_BACK_ORIGIN : u64 = 0 ;
5557 // Now that we have the tip, step back about 4 block intervals from tip, and do a fuzzy
5658 // iteration to find the exact two blocks at the end of the immutable chain.
5759 let step_back_search = point. slot_or_default ( ) - distance. into ( ) ;
5860
5961 // We stepped back to the origin, so just return Origin
60- if step_back_search == 0 . into ( ) {
62+ if step_back_search == STEP_BACK_ORIGIN . into ( ) {
6163 return Point :: ORIGIN ;
6264 }
6365
@@ -210,7 +212,7 @@ impl Iterator for MithrilSnapshotIteratorInner {
210212 if let Ok ( block) = maybe_block {
211213 if !self . previous . is_unknown ( ) {
212214 // We can safely fully decode this block.
213- match MultiEraBlock :: new ( self . chain , block, & self . previous , 0 . into ( ) ) {
215+ match MultiEraBlock :: new ( self . chain , block, & self . previous , Fork :: IMMUTABLE ) {
214216 Ok ( block_data) => {
215217 // Update the previous point
216218 // debug!("Pre Previous update 1 : {:?}", self.previous);
0 commit comments