File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -231,21 +231,29 @@ impl RPCRequestHandler for GetTenuresForkInfo {
231
231
chainstate,
232
232
& network. stacks_tip . block_id ( ) ,
233
233
) ?) ;
234
- let handle = sortdb. index_handle ( & cursor. sortition_id ) ;
235
234
let mut depth = 0 ;
236
235
while depth < DEPTH_LIMIT && cursor. consensus_hash != recurse_end {
237
236
depth += 1 ;
238
237
if height_bound >= cursor. block_height {
239
238
return Err ( ChainError :: NotInSameFork ) ;
240
239
}
241
- cursor = handle
242
- . get_last_snapshot_with_sortition ( cursor. block_height . saturating_sub ( 1 ) ) ?;
243
- results. push ( TenureForkingInfo :: from_snapshot (
244
- & cursor,
245
- sortdb,
246
- chainstate,
247
- & network. stacks_tip . block_id ( ) ,
248
- ) ?) ;
240
+
241
+ if cursor. sortition
242
+ || chainstate
243
+ . nakamoto_blocks_db ( )
244
+ . is_shadow_tenure ( & cursor. consensus_hash ) ?
245
+ {
246
+ results. push ( TenureForkingInfo :: from_snapshot (
247
+ & cursor,
248
+ sortdb,
249
+ chainstate,
250
+ & network. stacks_tip . block_id ( ) ,
251
+ ) ?) ;
252
+ }
253
+
254
+ cursor =
255
+ SortitionDB :: get_block_snapshot ( sortdb. conn ( ) , & cursor. parent_sortition_id ) ?
256
+ . ok_or_else ( || ChainError :: NoSuchBlockError ) ?;
249
257
}
250
258
251
259
Ok ( results)
You can’t perform that action at this time.
0 commit comments