mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
fix(txpool): prevent underflow in blobstore versioned hash lookup (#22454)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -82,8 +82,11 @@ impl DiskFileBlobStore {
|
||||
for (hash_idx, match_result) in
|
||||
blob_sidecar.match_versioned_hashes(versioned_hashes)
|
||||
{
|
||||
result[hash_idx] = Some(match_result);
|
||||
missing_count -= 1;
|
||||
let slot = &mut result[hash_idx];
|
||||
if slot.is_none() {
|
||||
missing_count -= 1;
|
||||
}
|
||||
*slot = Some(match_result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,11 @@ impl InMemoryBlobStore {
|
||||
for (hash_idx, match_result) in
|
||||
blob_sidecar.match_versioned_hashes(versioned_hashes)
|
||||
{
|
||||
result[hash_idx] = Some(match_result);
|
||||
missing_count -= 1;
|
||||
let slot = &mut result[hash_idx];
|
||||
if slot.is_none() {
|
||||
missing_count -= 1;
|
||||
}
|
||||
*slot = Some(match_result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user