From 395dbc0f40d5fbdabc58fb25b49927e84c66d9f2 Mon Sep 17 00:00:00 2001 From: DimAn Date: Fri, 3 Jun 2022 00:12:03 +0300 Subject: [PATCH] choose highest incremental snapshot first (#25584) --- validator/src/bootstrap.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/validator/src/bootstrap.rs b/validator/src/bootstrap.rs index 5aa554e0af..3a91a80e52 100644 --- a/validator/src/bootstrap.rs +++ b/validator/src/bootstrap.rs @@ -1108,8 +1108,8 @@ mod with_incremental_snapshots { /// /// The result is a vector of peers with snapshot hashes that: /// 1. match a snapshot hash from the known validators - /// 2. have the highest full snapshot slot - /// 3. have the highest incremental snapshot slot + /// 2. have the highest incremental snapshot slot + /// 3. have the highest full snapshot slot of (2) fn get_peer_snapshot_hashes( cluster_info: &ClusterInfo, validator_config: &ValidatorConfig, @@ -1124,10 +1124,10 @@ mod with_incremental_snapshots { &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, ); + retain_peer_snapshot_hashes_with_highest_full_snapshot_slot(&mut peer_snapshot_hashes); peer_snapshot_hashes }