Skip to content

Commit 4e45576

Browse files
committed
removed ChainLockStats
1 parent f9234fd commit 4e45576

File tree

2 files changed

+1
-52
lines changed

2 files changed

+1
-52
lines changed

dash-spv/src/chain/chainlock_manager.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -443,59 +443,8 @@ impl ChainLockManager {
443443
}
444444
}
445445
}
446-
447446
Ok(chain_locks)
448447
}
449-
450-
/// Get chain lock statistics
451-
pub fn get_stats(&self) -> ChainLockStats {
452-
let by_height = match self.chain_locks_by_height.read() {
453-
Ok(guard) => guard,
454-
Err(_) => {
455-
return ChainLockStats {
456-
total_chain_locks: 0,
457-
cached_by_height: 0,
458-
cached_by_hash: 0,
459-
highest_locked_height: None,
460-
lowest_locked_height: None,
461-
enforce_chain_locks: self.enforce_chain_locks,
462-
}
463-
}
464-
};
465-
let by_hash = match self.chain_locks_by_hash.read() {
466-
Ok(guard) => guard,
467-
Err(_) => {
468-
return ChainLockStats {
469-
total_chain_locks: 0,
470-
cached_by_height: 0,
471-
cached_by_hash: 0,
472-
highest_locked_height: None,
473-
lowest_locked_height: None,
474-
enforce_chain_locks: self.enforce_chain_locks,
475-
}
476-
}
477-
};
478-
479-
ChainLockStats {
480-
total_chain_locks: by_height.len(),
481-
cached_by_height: by_height.len(),
482-
cached_by_hash: by_hash.len(),
483-
highest_locked_height: by_height.keys().max().cloned(),
484-
lowest_locked_height: by_height.keys().min().cloned(),
485-
enforce_chain_locks: self.enforce_chain_locks,
486-
}
487-
}
488-
}
489-
490-
/// Chain lock statistics
491-
#[derive(Debug, Clone)]
492-
pub struct ChainLockStats {
493-
pub total_chain_locks: usize,
494-
pub cached_by_height: usize,
495-
pub cached_by_hash: usize,
496-
pub highest_locked_height: Option<u32>,
497-
pub lowest_locked_height: Option<u32>,
498-
pub enforce_chain_locks: bool,
499448
}
500449

501450
#[cfg(test)]

dash-spv/src/chain/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod reorg_test;
2626

2727
pub use chain_tip::{ChainTip, ChainTipManager};
2828
pub use chain_work::ChainWork;
29-
pub use chainlock_manager::{ChainLockEntry, ChainLockManager, ChainLockStats};
29+
pub use chainlock_manager::{ChainLockEntry, ChainLockManager};
3030
pub use checkpoints::{Checkpoint, CheckpointManager};
3131
pub use fork_detector::{ForkDetectionResult, ForkDetector};
3232
pub use orphan_pool::{OrphanBlock, OrphanPool, OrphanPoolStats};

0 commit comments

Comments
 (0)