diff --git a/core/src/crds_gossip_push.rs b/core/src/crds_gossip_push.rs index 264986d7bd..20e3700c7f 100644 --- a/core/src/crds_gossip_push.rs +++ b/core/src/crds_gossip_push.rs @@ -35,7 +35,7 @@ pub const CRDS_GOSSIP_PUSH_FANOUT: usize = 6; pub const CRDS_GOSSIP_PUSH_MSG_TIMEOUT_MS: u64 = 30000; pub const CRDS_GOSSIP_PRUNE_MSG_TIMEOUT_MS: u64 = 500; pub const CRDS_GOSSIP_PRUNE_STAKE_THRESHOLD_PCT: f64 = 0.15; -pub const CRDS_GOSSIP_PRUNE_MIN_INGRESS_NODES: usize = 2; +pub const CRDS_GOSSIP_PRUNE_MIN_INGRESS_NODES: usize = 3; // Do not push to peers which have not been updated for this long. const PUSH_ACTIVE_TIMEOUT_MS: u64 = 60_000; @@ -136,8 +136,12 @@ impl CrdsGossipPush { let mut keep = HashSet::new(); let mut peer_stake_sum = 0; + keep.insert(*origin); for next in shuffle { let (next_peer, next_stake) = staked_peers[next]; + if next_peer == *origin { + continue; + } keep.insert(next_peer); peer_stake_sum += next_stake; if peer_stake_sum >= prune_stake_threshold