Ensure that `extended_range` in `scan_complete` is a superset of `range`
Previously `extended_range` only covered the extent of the leaves of all subtrees in which notes were found during a scan. When the scanned range was large, this was not guaranteed to be contained within the subtree leaves, causing an assertion failure when an invalid `ScanRange` was constructed.
This commit is contained in:
parent
cb887efa06
commit
281dbd5524
|
@ -569,8 +569,8 @@ pub(crate) fn scan_complete<P: consensus::Parameters>(
|
||||||
let range_max = sapling_shard_end(*max_idx)?;
|
let range_max = sapling_shard_end(*max_idx)?;
|
||||||
|
|
||||||
Ok::<Range<BlockHeight>, rusqlite::Error>(Range {
|
Ok::<Range<BlockHeight>, rusqlite::Error>(Range {
|
||||||
start: range_min.unwrap_or(range.start),
|
start: range.start.min(range_min.unwrap_or(range.start)),
|
||||||
end: range_max.unwrap_or(range.end),
|
end: range.end.max(range_max.unwrap_or(range.end)),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.transpose()
|
.transpose()
|
||||||
|
|
Loading…
Reference in New Issue