Skip to content

Commit 5f83847

Browse files
committed
chore: search depth only increases with sortitions, not shadow blocks
1 parent 5970a57 commit 5f83847

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stackslib/src/net/api/get_tenures_fork_info.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ impl RPCRequestHandler for GetTenuresForkInfo {
233233
)?);
234234
let mut depth = 0;
235235
while depth < DEPTH_LIMIT && cursor.consensus_hash != recurse_end {
236-
depth += 1;
237236
if height_bound >= cursor.block_height {
238237
return Err(ChainError::NotInSameFork);
239238
}
@@ -252,6 +251,11 @@ impl RPCRequestHandler for GetTenuresForkInfo {
252251
&network.stacks_tip.block_id(),
253252
)?);
254253
}
254+
if cursor.sortition {
255+
// don't count shadow blocks towards the depth, since there can be a large
256+
// swath of them.
257+
depth += 1;
258+
}
255259
}
256260

257261
Ok(results)

0 commit comments

Comments
 (0)