Default --rpc-bind-address to 127.0.0.1 when --private-rpc is provided and --bind-address is not
(cherry picked from commit 221343e849
)
This commit is contained in:
@ -1589,7 +1589,7 @@ pub fn main() {
|
|||||||
.value_name("HOST")
|
.value_name("HOST")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.validator(solana_net_utils::is_host)
|
.validator(solana_net_utils::is_host)
|
||||||
.help("IP address to bind the RPC port [default: use --bind-address]"),
|
.help("IP address to bind the RPC port [default: 127.0.0.1 if --private-rpc is present, otherwise use --bind-address]"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("rpc_threads")
|
Arg::with_name("rpc_threads")
|
||||||
@ -2214,6 +2214,8 @@ pub fn main() {
|
|||||||
let rpc_bind_address = if matches.is_present("rpc_bind_address") {
|
let rpc_bind_address = if matches.is_present("rpc_bind_address") {
|
||||||
solana_net_utils::parse_host(matches.value_of("rpc_bind_address").unwrap())
|
solana_net_utils::parse_host(matches.value_of("rpc_bind_address").unwrap())
|
||||||
.expect("invalid rpc_bind_address")
|
.expect("invalid rpc_bind_address")
|
||||||
|
} else if private_rpc {
|
||||||
|
solana_net_utils::parse_host("127.0.0.1").unwrap()
|
||||||
} else {
|
} else {
|
||||||
bind_address
|
bind_address
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user