@@ -1046,7 +1046,7 @@ where
10461046 & self ,
10471047 mut current : Tipset ,
10481048 message : & ChainMessage ,
1049- min_epoch : ChainEpoch ,
1049+ lookback_max_epoch : ChainEpoch ,
10501050 allow_replaced : bool ,
10511051 ) -> Result < Option < ( Tipset , Receipt ) > , Error > {
10521052 let message_from_address = message. from ( ) ;
@@ -1056,7 +1056,7 @@ where
10561056 . map_err ( Error :: state) ?;
10571057 let message_from_id = self . lookup_required_id ( & message_from_address, & current) ?;
10581058
1059- while current. epoch ( ) >= min_epoch {
1059+ while current. epoch ( ) >= lookback_max_epoch {
10601060 let parent_tipset = self
10611061 . chain_index ( )
10621062 . load_required_tipset ( current. parents ( ) )
@@ -1092,16 +1092,6 @@ where
10921092 }
10931093
10941094 /// Searches backwards through the chain for a message receipt.
1095- ///
1096- /// # Arguments
1097- /// * `current` - The tipset to start searching from
1098- /// * `message` - The message to search for
1099- /// * `look_back_limit` - Maximum number of epochs to search backwards:
1100- /// - `None` or `Some(-1)` (LOOKBACK_NO_LIMIT): Search all the way to genesis
1101- /// - `Some(0)`: No search performed, returns `None` immediately
1102- /// - `Some(N)` where `N > 0`: Search back at most N epochs
1103- /// - `Some(N)` where `N >= current.epoch()`: Same as unlimited (to genesis)
1104- /// * `allow_replaced` - Whether to accept replacement messages (same nonce, different CID)
11051095 fn search_back_for_message (
11061096 & self ,
11071097 current : Tipset ,
@@ -1112,8 +1102,8 @@ where
11121102 let current_epoch = current. epoch ( ) ;
11131103 let allow_replaced = allow_replaced. unwrap_or ( true ) ;
11141104
1115- // Calculate the minimum epoch (inclusive lower bound) for the search.
1116- let min_epoch = match look_back_limit {
1105+ // Calculate the max lookback epoch (inclusive lower bound) for the search.
1106+ let lookback_max_epoch = match look_back_limit {
11171107 // No search: limit = 0 means search 0 epochs
11181108 Some ( 0 ) => return Ok ( None ) ,
11191109 // Limited search: calculate the inclusive lower bound
@@ -1123,7 +1113,7 @@ where
11231113 _ => 0 ,
11241114 } ;
11251115
1126- self . check_search ( current, message, min_epoch , allow_replaced)
1116+ self . check_search ( current, message, lookback_max_epoch , allow_replaced)
11271117 }
11281118
11291119 /// Returns a message receipt from a given tipset and message CID.
0 commit comments