Made the 'signers' an Arc, so that things compile.

This commit is contained in:
Luke Anderson 2019-03-28 21:00:38 +11:00
parent ba71e8adca
commit 867af4bc6a
No known key found for this signature in database
GPG Key ID: 44408169EC61E228

View File

@ -42,7 +42,7 @@ pub struct DutiesManager<U: BeaconNode> {
pub duties_map: RwLock<EpochDutiesMap>, pub duties_map: RwLock<EpochDutiesMap>,
/// A list of all signer objects known to the validator service. /// A list of all signer objects known to the validator service.
// TODO: Generalise the signers, so that they're not just keypairs // TODO: Generalise the signers, so that they're not just keypairs
pub signers: Vec<Keypair>, pub signers: Arc<Vec<Keypair>>,
pub beacon_node: Arc<U>, pub beacon_node: Arc<U>,
} }
@ -97,7 +97,7 @@ impl<U: BeaconNode> DutiesManager<U> {
// if the map is poisoned, return None // if the map is poisoned, return None
let duties = self.duties_map.read().ok()?; let duties = self.duties_map.read().ok()?;
for validator_signer in &self.signers { for validator_signer in self.signers.iter() {
match duties.is_work_slot(slot, &validator_signer) { match duties.is_work_slot(slot, &validator_signer) {
Ok(Some(work_type)) => current_work.push((validator_signer.clone(), work_type)), Ok(Some(work_type)) => current_work.push((validator_signer.clone(), work_type)),
Ok(None) => {} // No work for this validator Ok(None) => {} // No work for this validator