@@ -2417,9 +2417,7 @@ impl Node {
2417
2417
pub fn new_localhost_with_pubkey ( pubkey : & Pubkey ) -> Self {
2418
2418
let addr = IpAddr :: V4 ( Ipv4Addr :: LOCALHOST ) ;
2419
2419
let port_range = localhost_port_range_for_tests ( ) ;
2420
- let gossip_port = find_available_port_in_range ( addr, port_range)
2421
- . expect ( "At least one open port should be available" ) ;
2422
- let gossip_addr = SocketAddr :: new ( addr, gossip_port) ;
2420
+ let gossip_addr = SocketAddr :: new ( addr, port_range. 0 ) ;
2423
2421
#[ allow( deprecated) ] // new_single_bind will be merged in this function
2424
2422
Self :: new_single_bind ( pubkey, & gossip_addr, port_range, addr)
2425
2423
}
@@ -2485,19 +2483,18 @@ impl Node {
2485
2483
num_tvu_receive_sockets. get ( ) ,
2486
2484
)
2487
2485
. expect ( "tvu multi_bind" ) ;
2488
-
2489
2486
let ( tvu_quic_port, tvu_quic) =
2490
2487
Self :: bind_with_config ( bind_ip_addr, port_range, socket_config) ;
2491
-
2492
2488
let ( tpu_port, tpu_sockets) =
2493
2489
multi_bind_in_range_with_config ( bind_ip_addr, port_range, socket_config_reuseport, 32 )
2494
2490
. expect ( "tpu multi_bind" ) ;
2495
2491
2496
- let ( _tpu_port_quic, tpu_quic) = Self :: bind_with_config (
2492
+ let ( _tpu_port_quic, tpu_quic) = bind_in_range_with_config (
2497
2493
bind_ip_addr,
2498
2494
( tpu_port + QUIC_PORT_OFFSET , tpu_port + QUIC_PORT_OFFSET + 1 ) ,
2499
2495
socket_config_reuseport,
2500
- ) ;
2496
+ )
2497
+ . expect ( "TPU quic port bind should succeed" ) ;
2501
2498
let tpu_quic =
2502
2499
bind_more_with_config ( tpu_quic, num_quic_endpoints. get ( ) , socket_config_reuseport)
2503
2500
. unwrap ( ) ;
@@ -2506,14 +2503,15 @@ impl Node {
2506
2503
multi_bind_in_range_with_config ( bind_ip_addr, port_range, socket_config_reuseport, 8 )
2507
2504
. expect ( "tpu_forwards multi_bind" ) ;
2508
2505
2509
- let ( _tpu_forwards_port_quic, tpu_forwards_quic) = Self :: bind_with_config (
2506
+ let ( _tpu_forwards_port_quic, tpu_forwards_quic) = bind_in_range_with_config (
2510
2507
bind_ip_addr,
2511
2508
(
2512
2509
tpu_forwards_port + QUIC_PORT_OFFSET ,
2513
2510
tpu_forwards_port + QUIC_PORT_OFFSET + 1 ,
2514
2511
) ,
2515
2512
socket_config_reuseport,
2516
- ) ;
2513
+ )
2514
+ . expect ( "TPU QUIC binding should succeed" ) ;
2517
2515
let tpu_forwards_quic = bind_more_with_config (
2518
2516
tpu_forwards_quic,
2519
2517
num_quic_endpoints. get ( ) ,
0 commit comments