File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -1500,21 +1500,15 @@ impl BurnchainConfigFile {
1500
1500
. unwrap_or ( default_burnchain_config. commit_anchor_block_within ) ,
1501
1501
peer_host : match self . peer_host . as_ref ( ) {
1502
1502
Some ( peer_host) => {
1503
- // Using std::net::LookupHost would be preferable, but it's
1504
- // unfortunately unstable at this point.
1505
- // https://doc.rust-lang.org/1.6.0/std/net/struct.LookupHost.html
1506
- let mut sock_addrs = format ! ( "{peer_host}:1" )
1503
+ format ! ( "{}:1" , & peer_host)
1507
1504
. to_socket_addrs ( )
1508
- . map_err ( |e| format ! ( "Invalid burnchain.peer_host: {e}" ) ) ?;
1509
- let sock_addr = match sock_addrs. next ( ) {
1510
- Some ( addr) => addr,
1511
- None => {
1512
- return Err ( format ! (
1513
- "No IP address could be queried for '{peer_host}'"
1514
- ) ) ;
1515
- }
1516
- } ;
1517
- format ! ( "{}" , sock_addr. ip( ) )
1505
+ . map_err ( |e| format ! ( "Invalid burnchain.peer_host: {}" , & e) ) ?
1506
+ . next ( )
1507
+ . is_none ( )
1508
+ . then ( || {
1509
+ return format ! ( "No IP address could be queried for '{}'" , & peer_host) ;
1510
+ } ) ;
1511
+ peer_host. clone ( )
1518
1512
}
1519
1513
None => default_burnchain_config. peer_host ,
1520
1514
} ,
You can’t perform that action at this time.
0 commit comments