mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Use full pubkey for validator directories
This commit is contained in:
@@ -22,6 +22,11 @@ fn keypair_file(prefix: &str) -> String {
|
|||||||
format!("{}_keypair", prefix)
|
format!("{}_keypair", prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the name of the folder to be generated for a validator with the given voting key.
|
||||||
|
fn dir_name(voting_pubkey: &PublicKey) -> String {
|
||||||
|
format!("0x{}", hex::encode(voting_pubkey.as_ssz_bytes()))
|
||||||
|
}
|
||||||
|
|
||||||
/// Represents the files/objects for each dedicated lighthouse validator directory.
|
/// Represents the files/objects for each dedicated lighthouse validator directory.
|
||||||
///
|
///
|
||||||
/// Generally lives in `~/.lighthouse/validators/`.
|
/// Generally lives in `~/.lighthouse/validators/`.
|
||||||
@@ -176,7 +181,7 @@ impl ValidatorDirectoryBuilder {
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.ok_or_else(|| "directory requires a voting_keypair")?;
|
.ok_or_else(|| "directory requires a voting_keypair")?;
|
||||||
|
|
||||||
let directory = base_path.join(voting_keypair.identifier());
|
let directory = base_path.join(dir_name(&voting_keypair.pk));
|
||||||
|
|
||||||
if directory.exists() {
|
if directory.exists() {
|
||||||
return Err(format!(
|
return Err(format!(
|
||||||
|
|||||||
Reference in New Issue
Block a user