zcash_client_sqlite: Fix off-by-one in `scan_complete`
Shard end heights are end-inclusive, while Rust `Range`s are end-exclusive. Co-authored-by: Kris Nuttycombe <kris@nutty.land>
This commit is contained in:
parent
b54969953f
commit
7a4954c242
|
@ -674,8 +674,9 @@ pub(crate) fn scan_complete<P: consensus::Parameters>(
|
||||||
let range_min =
|
let range_min =
|
||||||
range_min.map(|h| wallet_birthday.map_or(h, |b| std::cmp::max(b, h)));
|
range_min.map(|h| wallet_birthday.map_or(h, |b| std::cmp::max(b, h)));
|
||||||
|
|
||||||
// get the block height for the end of the current shard
|
// Get the block height for the end of the current shard, and make it an
|
||||||
let range_max = sapling_shard_end(*max_idx)?;
|
// exclusive end bound.
|
||||||
|
let range_max = sapling_shard_end(*max_idx)?.map(|end| end + 1);
|
||||||
|
|
||||||
Ok::<Range<BlockHeight>, rusqlite::Error>(Range {
|
Ok::<Range<BlockHeight>, rusqlite::Error>(Range {
|
||||||
start: range.start.min(range_min.unwrap_or(range.start)),
|
start: range.start.min(range_min.unwrap_or(range.start)),
|
||||||
|
|
Loading…
Reference in New Issue