Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix: use map len
Browse files Browse the repository at this point in the history
  • Loading branch information
seerscode committed May 8, 2019
1 parent 86b488c commit 0a03d71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/consensus/slots/src/aux_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const SLOT_HEADER_MAP_KEY: &[u8] = b"slot_header_map";
/// We keep at least this number of slots in database.
pub const MAX_SLOT_CAPACITY: u64 = 1000;
/// We prune slots when they reach this number.
pub const PRUNING_BOUND: u64 = MAX_SLOT_CAPACITY + 1000;
pub const PRUNING_BOUND: usize = MAX_SLOT_CAPACITY as usize + 1000;

fn load_decode<C, T>(backend: Arc<C>, key: &[u8]) -> ClientResult<Option<T>>
where
Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn check_equivocation<C, H>(
},
};

if slot > PRUNING_BOUND {
if slot_header_map.len() > PRUNING_BOUND {
slot_header_map = slot_header_map.split_off(&(slot - MAX_SLOT_CAPACITY));
}

Expand Down

0 comments on commit 0a03d71

Please sign in to comment.