Skip to content

Commit

Permalink
patches ClusterInfo::spy_node
Browse files Browse the repository at this point in the history
  • Loading branch information
behzadnouri committed Jun 5, 2024
1 parent d6bf04a commit fc39425
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ use {
restart_crds_values::{
RestartHeaviestFork, RestartLastVotedForkSlots, RestartLastVotedForkSlotsError,
},
socketaddr, socketaddr_any,
weighted_shuffle::WeightedShuffle,
},
bincode::{serialize, serialized_size},
Expand Down Expand Up @@ -2807,9 +2806,12 @@ impl ClusterInfo {
shred_version: u16,
) -> (ContactInfo, UdpSocket, Option<TcpListener>) {
let bind_ip_addr = IpAddr::V4(Ipv4Addr::UNSPECIFIED);
let (_, gossip_socket) = bind_in_range(bind_ip_addr, VALIDATOR_PORT_RANGE).unwrap();
let contact_info = Self::gossip_contact_info(id, socketaddr_any!(), shred_version);

let (port, gossip_socket) = bind_in_range(bind_ip_addr, VALIDATOR_PORT_RANGE).unwrap();
let contact_info = Self::gossip_contact_info(
id,
SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port),
shred_version,
);
(contact_info, gossip_socket, None)
}
}
Expand Down Expand Up @@ -3288,6 +3290,7 @@ mod tests {
crds_gossip_pull::tests::MIN_NUM_BLOOM_FILTERS,
crds_value::{AccountsHashes, CrdsValue, CrdsValueLabel, Vote as CrdsVote},
duplicate_shred::{self, tests::new_rand_shred, MAX_DUPLICATE_SHREDS},
socketaddr,
},
itertools::izip,
solana_ledger::shred::Shredder,
Expand Down

0 comments on commit fc39425

Please sign in to comment.