Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
fix bootstrap without known validators (#25293)
Browse files Browse the repository at this point in the history
  • Loading branch information
diman-io authored May 18, 2022
1 parent 5548baf commit 2412276
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions validator/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,14 +1114,15 @@ mod with_incremental_snapshots {
validator_config: &ValidatorConfig,
rpc_peers: &[ContactInfo],
) -> Vec<PeerSnapshotHash> {
let known_snapshot_hashes =
get_snapshot_hashes_from_known_validators(cluster_info, validator_config);

let mut peer_snapshot_hashes = get_eligible_peer_snapshot_hashes(cluster_info, rpc_peers);
retain_peer_snapshot_hashes_that_match_known_snapshot_hashes(
&known_snapshot_hashes,
&mut peer_snapshot_hashes,
);
if validator_config.known_validators.is_some() {
let known_snapshot_hashes =
get_snapshot_hashes_from_known_validators(cluster_info, validator_config);
retain_peer_snapshot_hashes_that_match_known_snapshot_hashes(
&known_snapshot_hashes,
&mut peer_snapshot_hashes,
);
}
retain_peer_snapshot_hashes_with_highest_full_snapshot_slot(&mut peer_snapshot_hashes);
retain_peer_snapshot_hashes_with_highest_incremental_snapshot_slot(
&mut peer_snapshot_hashes,
Expand Down

0 comments on commit 2412276

Please sign in to comment.