Move ValidatorExit into ValidatorConfig, making it accessible from the solana-validator crate

This commit is contained in:
Michael Vines
2021-03-01 13:20:04 -08:00
parent f1223fb783
commit 640e36287e
3 changed files with 31 additions and 23 deletions

View File

@@ -267,7 +267,7 @@ impl JsonRpcService {
poh_recorder: Option<Arc<Mutex<PohRecorder>>>,
genesis_hash: Hash,
ledger_path: &Path,
validator_exit: Arc<RwLock<Option<ValidatorExit>>>,
validator_exit: Arc<RwLock<ValidatorExit>>,
trusted_validators: Option<HashSet<Pubkey>>,
override_health_check: Arc<AtomicBool>,
optimistically_confirmed_bank: Arc<RwLock<OptimisticallyConfirmedBank>>,
@@ -434,9 +434,8 @@ impl JsonRpcService {
let close_handle = close_handle_receiver.recv().unwrap();
let close_handle_ = close_handle.clone();
let mut validator_exit_write = validator_exit.write().unwrap();
validator_exit_write
.as_mut()
validator_exit
.write()
.unwrap()
.register_exit(Box::new(move || close_handle_.close()));
Self {