Skip to content

Commit f898b87

Browse files
committed
Fix off by one error.
The meaning of offset has changed to be the proper offset, not the child offset, when I introduced push and getmany requests. This updates the probing to the new meaning of offset.
1 parent bf1c4ff commit f898b87

File tree

1 file changed

+1
-1
lines changed
  • content-discovery/iroh-content-tracker/src

1 file changed

+1
-1
lines changed

content-discovery/iroh-content-tracker/src/tracker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ impl Tracker {
10801080
else {
10811081
unreachable!("request does not include root");
10821082
};
1083-
let index = usize::try_from(child.offset()).expect("child offset too large");
1083+
let index = usize::try_from(child.offset() - 1).expect("child offset too large");
10841084
let hash = hs.get(index).expect("request inconsistent with hash seq");
10851085
let at_blob_header = child.next(hash);
10861086
let at_end_blob = at_blob_header.drain().await?;

0 commit comments

Comments
 (0)