فهرست منبع

block_store: include end value in get_order_by_range queries

Updated `get_order_by_range` to use an inclusive range (`..=`), ensuring the `end` value is part of the result.
kalm 1 سال پیش
والد
کامیت
5a3eb06497
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/blockchain/block_store.rs

+ 1 - 1
src/blockchain/block_store.rs

@@ -522,7 +522,7 @@ impl BlockStore {
         let start_key = start.to_be_bytes();
         let start_key = start.to_be_bytes();
         let end_key = end.to_be_bytes();
         let end_key = end.to_be_bytes();
 
 
-        for block in self.order.range(start_key..end_key) {
+        for block in self.order.range(start_key..=end_key) {
             blocks.push(parse_u32_key_record(block.unwrap())?);
             blocks.push(parse_u32_key_record(block.unwrap())?);
         }
         }