Skip to content

Commit

Permalink
fix reachable_bytes calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 committed Mar 16, 2023
1 parent f757e84 commit c13ebb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions node/db/src/rolling/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ where
let block = db
.get(&cid)?
.ok_or_else(|| anyhow::anyhow!("Cid {cid} not found in blockstore"))?;

let pair = (cid.to_bytes(), block.clone());
reachable_bytes.fetch_add(pair.0.len() + pair.1.len(), atomic::Ordering::Relaxed);
if !db.current().has(&cid)? {
let pair = (cid.to_bytes(), block.clone());
reachable_bytes
.fetch_add(pair.0.len() + pair.1.len(), atomic::Ordering::Relaxed);
tx.send_async(pair).await?;
}

Expand Down

0 comments on commit c13ebb9

Please sign in to comment.