random clippy
This commit is contained in:
@@ -127,7 +127,7 @@ impl DailyMerkleTree {
|
||||
pub(crate) fn maybe_rebuild(&mut self) {
|
||||
// every 1000 leaves, rebuild the tree to purge the history
|
||||
// (I wish the API of the library allowed to do it without having to go through those extra steps...)
|
||||
if !self.inserted_leaves.is_empty() && self.inserted_leaves.len() % 1000 == 0 {
|
||||
if !self.inserted_leaves.is_empty() && self.inserted_leaves.len().is_multiple_of(1000) {
|
||||
self.rebuild_without_history();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -803,7 +803,7 @@ impl EcashState {
|
||||
merkle_entry.maybe_rebuild();
|
||||
|
||||
// toss a coin to check if we should clean memory of old merkle trees
|
||||
if thread_rng().next_u32() % 10000 == 0 {
|
||||
if thread_rng().next_u32().is_multiple_of(10000) {
|
||||
let mut values_to_clean = Vec::new();
|
||||
let cutoff = self.config.ticketbook_retention_cutoff();
|
||||
info!("attempting to remove old issued ticketbooks. the cutoff is set to {cutoff}");
|
||||
|
||||
Reference in New Issue
Block a user