Skip to content

Commit 24c61df

Browse files
CopilotSteake
andcommitted
Add documentation and fix code review feedback
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
1 parent dcaa0a6 commit 24c61df

2 files changed

Lines changed: 445 additions & 11 deletions

File tree

crates/bitcell-state/src/storage.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,9 @@ impl StorageManager {
249249
let (key, value) = item.map_err(|e| e.to_string())?;
250250

251251
// Key format is: sender||height(8)||tx_hash
252-
// Verify exact sender match by checking if key length >= sender.len() + 8
253-
// and that the next 8 bytes after sender are valid height bytes
252+
// Verify exact sender match and valid key structure
254253
if key.len() < sender.len() + 8 {
255-
continue; // Invalid key format
254+
continue; // Invalid key format (too short)
256255
}
257256

258257
// Check if sender portion matches exactly
@@ -261,14 +260,6 @@ impl StorageManager {
261260
break; // No longer matching our sender prefix
262261
}
263262

264-
// Verify this is an exact match by checking that at sender.len() we have
265-
// height data (8 bytes), not more sender data
266-
// We do this by ensuring the key has the expected structure
267-
let expected_min_len = sender.len() + 8; // sender + height
268-
if key.len() < expected_min_len {
269-
continue;
270-
}
271-
272263
tx_hashes.push(value.to_vec());
273264

274265
if limit > 0 && tx_hashes.len() >= limit {

0 commit comments

Comments
 (0)