Improve address in use error message for RPC pubsub

This commit is contained in:
Michael Vines 2020-04-13 10:47:30 -07:00
parent 92a5a51632
commit 37b048effb
1 changed files with 2 additions and 2 deletions

View File

@ -1005,12 +1005,12 @@ pub fn main() {
let mut tcp_listeners = vec![];
if !private_rpc {
if let Some((rpc_port, rpc_pubsub_port)) = validator_config.rpc_ports {
for port in &[rpc_port, rpc_pubsub_port] {
for (purpose, port) in &[("RPC", rpc_port), ("RPC pubsub", rpc_pubsub_port)] {
tcp_listeners.push((
*port,
TcpListener::bind(&SocketAddr::from((rpc_bind_address, *port)))
.unwrap_or_else(|err| {
error!("Unable to bind to tcp/{}: {}", port, err);
error!("Unable to bind to tcp/{} for {}: {}", port, purpose, err);
std::process::exit(1);
}),
));