fix bootstrap without known validators (#25293)

This commit is contained in:
DimAn 2022-05-18 14:12:05 +03:00 committed by GitHub
parent 5548baf4dd
commit 24122768da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -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,