Skip to content

Commit

Permalink
only unique
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Dec 26, 2023
1 parent 5ea27e2 commit f9404b1
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

import com.codahale.metrics.Timer;
import com.google.common.base.Objects;
import com.salesforce.apollo.fireflies.proto.*;
import com.salesforce.apollo.fireflies.proto.Update.Builder;
import com.salesforce.apollo.bloomFilters.BloomFilter;
import com.salesforce.apollo.cryptography.Digest;
import com.salesforce.apollo.cryptography.DigestAlgorithm;
import com.salesforce.apollo.cryptography.HexBloom;
import com.salesforce.apollo.fireflies.Binding.Bound;
import com.salesforce.apollo.fireflies.View.Node;
import com.salesforce.apollo.fireflies.View.Participant;
import com.salesforce.apollo.fireflies.proto.*;
import com.salesforce.apollo.fireflies.proto.Update.Builder;
import com.salesforce.apollo.membership.Context;
import com.salesforce.apollo.membership.ReservoirSampler;
import com.salesforce.apollo.stereotomy.EventCoordinates;
Expand Down Expand Up @@ -461,9 +461,10 @@ private void initiateViewChange() {

private void joined(Collection<SignedNote> seedSet, Digest from, StreamObserver<Gateway> responseObserver,
Timer.Context timer) {
final var builder = Gateway.newBuilder().addAllInitialSeedSet(seedSet).setDiadem(diadem.get().toHexBloome());
context.successors(from, m -> context.isActive(m))
.forEach(p -> builder.addInitialSeedSet(p.getNote().getWrapped()));
var unique = new HashSet<SignedNote>(seedSet);
context.successors(from, m -> context.isActive(m)).forEach(p -> unique.add(p.getNote().getWrapped()));
final var builder = Gateway.newBuilder().addAllInitialSeedSet(unique).setDiadem(diadem.get().toHexBloome());
log.trace("Gateway initial seeding: {} for: {} on: {}", builder.getInitialSeedSetCount(), from, node.getId());
var gateway = builder.build();
responseObserver.onNext(gateway);
responseObserver.onCompleted();
Expand Down

0 comments on commit f9404b1

Please sign in to comment.