From a8f1f7844e525cd77b8fc2da62340e5d9fdf1bfe Mon Sep 17 00:00:00 2001 From: Daan Wynen Date: Mon, 22 Jul 2024 10:50:48 +0200 Subject: [PATCH] fix: pass closed range to blob range query --- solar/src/storage/kv.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/solar/src/storage/kv.rs b/solar/src/storage/kv.rs index d4bcae1..824c473 100644 --- a/solar/src/storage/kv.rs +++ b/solar/src/storage/kv.rs @@ -136,8 +136,9 @@ impl KvStorage { let mut list = Vec::new(); let db = self.db.as_ref().ok_or(Error::OptionIsNone)?; - let scan_key: &[u8] = &[PREFIX_BLOB]; - for item in db.range(scan_key..) { + let scan_key_start: &[u8] = &[PREFIX_BLOB]; + let scan_key_end: &[u8] = &[PREFIX_BLOB + 1]; + for item in db.range(scan_key_start..scan_key_end) { let (k, v) = item?; let blob: BlobStatus = serde_cbor::from_slice(&v)?; if !blob.retrieved {