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 @@ -1482,21 +1482,15 @@ impl BurnchainConfigFile {
1482
1482
. unwrap_or ( default_burnchain_config. commit_anchor_block_within ) ,
1483
1483
peer_host : match self . peer_host . as_ref ( ) {
1484
1484
Some ( peer_host) => {
1485
- // Using std::net::LookupHost would be preferable, but it's
1486
- // unfortunately unstable at this point.
1487
- // https://doc.rust-lang.org/1.6.0/std/net/struct.LookupHost.html
1488
- let mut sock_addrs = format ! ( "{peer_host}:1" )
1485
+ format ! ( "{}:1" , & peer_host)
1489
1486
. to_socket_addrs ( )
1490
- . map_err ( |e| format ! ( "Invalid burnchain.peer_host: {e}" ) ) ?;
1491
- let sock_addr = match sock_addrs. next ( ) {
1492
- Some ( addr) => addr,
1493
- None => {
1494
- return Err ( format ! (
1495
- "No IP address could be queried for '{peer_host}'"
1496
- ) ) ;
1497
- }
1498
- } ;
1499
- format ! ( "{}" , sock_addr. ip( ) )
1487
+ . map_err ( |e| format ! ( "Invalid burnchain.peer_host: {}" , & e) ) ?
1488
+ . next ( )
1489
+ . is_none ( )
1490
+ . then ( || {
1491
+ return format ! ( "No IP address could be queried for '{}'" , & peer_host) ;
1492
+ } ) ;
1493
+ peer_host. clone ( )
1500
1494
}
1501
1495
None => default_burnchain_config. peer_host ,
1502
1496
} ,
You can’t perform that action at this time.
0 commit comments