Skip to content

Commit

Permalink
removes early return if prune_messages are empty (#3006)
Browse files Browse the repository at this point in the history
Even if there are no outgoing prune messages we still need to generate
outgoing push messages for packets just received, so the code should not
early return here:
https://github.com/anza-xyz/agave/blob/d2cc71f0d/gossip/src/cluster_info.rs#L2400-L2402
  • Loading branch information
behzadnouri authored Sep 27, 2024
1 parent 46f5fce commit ce15821
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2397,9 +2397,6 @@ impl ClusterInfo {
.collect()
})
};
if prune_messages.is_empty() {
return;
}
let mut packet_batch = PacketBatch::new_unpinned_with_recycler_data_and_dests(
recycler,
"handle_batch_push_messages",
Expand Down Expand Up @@ -2429,7 +2426,9 @@ impl ClusterInfo {
self.stats
.packets_sent_push_messages_count
.add_relaxed((packet_batch.len() - num_prune_packets) as u64);
let _ = response_sender.send(packet_batch);
if !packet_batch.is_empty() {
let _ = response_sender.send(packet_batch);
}
}

fn require_stake_for_gossip(&self, stakes: &HashMap<Pubkey, u64>) -> bool {
Expand Down

0 comments on commit ce15821

Please sign in to comment.