From 0c2839660805dac2d4d5560dd02913b45d28ae13 Mon Sep 17 00:00:00 2001 From: stringhandler Date: Thu, 5 Dec 2024 14:18:34 +0200 Subject: [PATCH] fmt --- src/sharechain/p2chain.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sharechain/p2chain.rs b/src/sharechain/p2chain.rs index cb99166..3f655da 100644 --- a/src/sharechain/p2chain.rs +++ b/src/sharechain/p2chain.rs @@ -201,11 +201,11 @@ impl P2Chain { self.levels.len() as u64 >= self.total_size + SAFETY_MARGIN + MAX_EXTRA_SYNC } - fn cleanup_chain(&mut self) -> Result<(), ShareChainError>{ + fn cleanup_chain(&mut self) -> Result<(), ShareChainError> { let mut first_index = self.levels.back().map(|level| level.height).unwrap_or(0); let mut current_chain_length = self.current_tip.saturating_sub(first_index); // let see if we are the limit for the current chain - while current_chain_length > self.total_size + SAFETY_MARGIN{ + while current_chain_length > self.total_size + SAFETY_MARGIN { self.levels.pop_back().ok_or(ShareChainError::BlockLevelNotFound)?; first_index = self.levels.back().map(|level| level.height).unwrap_or(0); current_chain_length = self.current_tip.saturating_sub(first_index);