mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Address Michael's comments
This commit is contained in:
@@ -90,16 +90,8 @@ impl DutiesStore {
|
||||
return InsertOutcome::Invalid;
|
||||
}
|
||||
|
||||
if store.contains_key(&duties.validator_pubkey) {
|
||||
let validator_map = store.get_mut(&duties.validator_pubkey).expect(
|
||||
"Store is exclusively locked and this path is guarded to ensure the key exists.",
|
||||
);
|
||||
|
||||
if validator_map.contains_key(&epoch) {
|
||||
let known_duties = validator_map.get_mut(&epoch).expect(
|
||||
"Validator map is exclusively mutable and this path is guarded to ensure the key exists.",
|
||||
);
|
||||
|
||||
if let Some(validator_map) = store.get_mut(&duties.validator_pubkey) {
|
||||
if let Some(known_duties) = validator_map.get_mut(&epoch) {
|
||||
if *known_duties == duties {
|
||||
InsertOutcome::Identical
|
||||
} else {
|
||||
|
||||
@@ -202,11 +202,11 @@ impl ValidatorDirectoryBuilder {
|
||||
let voting_keypair = self
|
||||
.voting_keypair
|
||||
.clone()
|
||||
.ok_or_else(|| "build requires a voting_keypair")?;
|
||||
.ok_or_else(|| "write_keypair_files requires a voting_keypair")?;
|
||||
let withdrawal_keypair = self
|
||||
.withdrawal_keypair
|
||||
.clone()
|
||||
.ok_or_else(|| "build requires a withdrawal_keypair")?;
|
||||
.ok_or_else(|| "write_keypair_files requires a withdrawal_keypair")?;
|
||||
|
||||
self.save_keypair(voting_keypair, VOTING_KEY_PREFIX)?;
|
||||
self.save_keypair(withdrawal_keypair, WITHDRAWAL_KEY_PREFIX)?;
|
||||
|
||||
Reference in New Issue
Block a user