diff --git a/validator/src/bootstrap.rs b/validator/src/bootstrap.rs index be254789e5..25859f9fc9 100644 --- a/validator/src/bootstrap.rs +++ b/validator/src/bootstrap.rs @@ -1276,7 +1276,9 @@ mod with_incremental_snapshots { .get(&peer_snapshot_hash.snapshot_hash.full) .map(|trusted_incremental_hashes| { if peer_snapshot_hash.snapshot_hash.incr.is_none() { - false + // If the peer's full snapshot hashes match, but doesn't have any + // incremental snapshots, that's fine; keep 'em! + true } else { trusted_incremental_hashes .contains(peer_snapshot_hash.snapshot_hash.incr.as_ref().unwrap()) @@ -1700,11 +1702,14 @@ mod with_incremental_snapshots { ), ]; - let expected = vec![PeerSnapshotHash::new( - contact_info, - *trusted_full_snapshot_hash, - Some(*trusted_incremental_snapshot_hash), - )]; + let expected = vec![ + PeerSnapshotHash::new(contact_info.clone(), *trusted_full_snapshot_hash, None), + PeerSnapshotHash::new( + contact_info, + *trusted_full_snapshot_hash, + Some(*trusted_incremental_snapshot_hash), + ), + ]; let mut actual = peer_snapshot_hashes; retain_trusted_peer_snapshot_hashes(&trusted_snapshot_hashes, &mut actual); assert_eq!(expected, actual);