Skip to content

Commit 5d9f472

Browse files
committed
fix: fix stacks-inspect so that the block ranges correspond to heights, not rowids
1 parent c13e521 commit 5d9f472

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

stackslib/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,7 @@ simulating a miner.
906906
.parse::<u64>()
907907
.expect("<start_block> not a valid u64");
908908
let arg5 = argv[5].parse::<u64>().expect("<end_block> not a valid u64");
909-
let start = arg4.saturating_sub(1);
910-
let blocks = arg5.saturating_sub(arg4);
911-
format!("SELECT index_block_hash FROM staging_blocks ORDER BY height ASC LIMIT {start}, {blocks}")
909+
format!("SELECT index_block_hash FROM staging_blocks WHERE height >= {arg4} AND height < {arg5} ORDER BY height ASC, index_block_hash ASC")
912910
}
913911
Some("last") => format!(
914912
"SELECT index_block_hash FROM staging_blocks ORDER BY height DESC LIMIT {}",

0 commit comments

Comments
 (0)