Only check the entrypoint's RPC address (#6851)
This commit is contained in:
parent
24a7b0ce74
commit
0fbd508c5f
|
@ -203,10 +203,13 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||
|
||||
let rpc_addrs: Vec<_> = nodes
|
||||
.iter()
|
||||
.filter_map(ContactInfo::valid_client_facing_addr)
|
||||
.map(|addrs| addrs.0)
|
||||
.filter(|rpc_addr| {
|
||||
matches.is_present("all") || rpc_addr.ip() == entrypoint_addr.ip()
|
||||
.filter_map(|contact_info| {
|
||||
if (matches.is_present("all") || contact_info.gossip == entrypoint_addr)
|
||||
&& ContactInfo::is_valid_address(&contact_info.rpc)
|
||||
{
|
||||
return Some(contact_info.rpc);
|
||||
}
|
||||
None
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
|
|
@ -181,13 +181,20 @@ fn initialize_ledger_path(
|
|||
|
||||
let rpc_addr = nodes
|
||||
.iter()
|
||||
.filter_map(ContactInfo::valid_client_facing_addr)
|
||||
.map(|addrs| addrs.0)
|
||||
.find(|rpc_addr| rpc_addr.ip() == entrypoint.gossip.ip())
|
||||
.filter_map(|contact_info| {
|
||||
if contact_info.gossip == entrypoint.gossip
|
||||
&& ContactInfo::is_valid_address(&contact_info.rpc)
|
||||
{
|
||||
Some(contact_info.rpc)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.next()
|
||||
.unwrap_or_else(|| {
|
||||
error!(
|
||||
"Entrypoint ({:?}) is not running the RPC service",
|
||||
entrypoint.gossip.ip()
|
||||
entrypoint.gossip
|
||||
);
|
||||
exit(1);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue