Use Arc instead of &Arc in AccountsHashVerifier::new (#31269)

This commit is contained in:
Brooks 2023-04-19 11:10:08 -04:00 committed by GitHub
parent 1d14156832
commit 80b27f3cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 12 deletions

View File

@ -49,8 +49,8 @@ impl AccountsHashVerifier {
accounts_package_sender: Sender<AccountsPackage>,
accounts_package_receiver: Receiver<AccountsPackage>,
snapshot_package_sender: Option<Sender<SnapshotPackage>>,
exit: &Arc<AtomicBool>,
cluster_info: &Arc<ClusterInfo>,
exit: Arc<AtomicBool>,
cluster_info: Arc<ClusterInfo>,
known_validators: Option<HashSet<Pubkey>>,
halt_on_known_validators_accounts_hash_mismatch: bool,
accounts_hash_fault_injector: Option<AccountsHashFaultInjector>,
@ -58,8 +58,6 @@ impl AccountsHashVerifier {
) -> Self {
// If there are no accounts packages to process, limit how often we re-check
const LOOP_LIMITER: Duration = Duration::from_millis(DEFAULT_MS_PER_SLOT);
let exit = exit.clone();
let cluster_info = cluster_info.clone();
let t_accounts_hash_verifier = Builder::new()
.name("solAcctHashVer".to_string())
.spawn(move || {
@ -217,7 +215,7 @@ impl AccountsHashVerifier {
halt_on_known_validator_accounts_hash_mismatch: bool,
snapshot_package_sender: Option<&Sender<SnapshotPackage>>,
hashes: &mut Vec<(Slot, Hash)>,
exit: &Arc<AtomicBool>,
exit: &AtomicBool,
snapshot_config: &SnapshotConfig,
accounts_hash_fault_injector: Option<AccountsHashFaultInjector>,
) {
@ -483,7 +481,7 @@ impl AccountsHashVerifier {
known_validators: Option<&HashSet<Pubkey>>,
halt_on_known_validator_accounts_hash_mismatch: bool,
hashes: &mut Vec<(Slot, Hash)>,
exit: &Arc<AtomicBool>,
exit: &AtomicBool,
accounts_hash: AccountsHashEnum,
accounts_hash_fault_injector: Option<AccountsHashFaultInjector>,
) {

View File

@ -711,8 +711,8 @@ impl Validator {
accounts_package_sender.clone(),
accounts_package_receiver,
snapshot_package_sender,
&exit,
&cluster_info,
exit.clone(),
cluster_info.clone(),
config.known_validators.clone(),
config.halt_on_known_validators_accounts_hash_mismatch,
config.accounts_hash_fault_injector,

View File

@ -195,8 +195,8 @@ impl BackgroundServices {
accounts_package_sender.clone(),
accounts_package_receiver,
Some(snapshot_package_sender),
&exit,
&cluster_info,
exit.clone(),
cluster_info,
None,
false,
None,

View File

@ -1001,8 +1001,8 @@ fn test_snapshots_with_background_services(
accounts_package_sender,
accounts_package_receiver,
Some(snapshot_package_sender),
&exit,
&cluster_info,
exit.clone(),
cluster_info,
None,
false,
None,