mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
chore: use EXPERIMENTAL for BOLT7 DNS #911
Changelog-EXPERIMENTAL: Ability to announce DNS addresses
This commit is contained in:
committed by
Rusty Russell
parent
2b8896a0b5
commit
a3ea9fdc87
@@ -928,12 +928,14 @@ static void try_connect_one_addr(struct connecting *connect)
|
||||
bool use_proxy = connect->daemon->always_use_proxy;
|
||||
const struct wireaddr_internal *addr = &connect->addrs[connect->addrnum];
|
||||
struct io_conn *conn;
|
||||
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
|
||||
bool use_dns = connect->daemon->use_dns;
|
||||
struct addrinfo hints, *ais, *aii;
|
||||
struct wireaddr_internal addrhint;
|
||||
int gai_err;
|
||||
struct sockaddr_in *sa4;
|
||||
struct sockaddr_in6 *sa6;
|
||||
#endif
|
||||
|
||||
/* In case we fail without a connection, make destroy_io_conn happy */
|
||||
connect->conn = NULL;
|
||||
@@ -984,6 +986,7 @@ static void try_connect_one_addr(struct connecting *connect)
|
||||
af = AF_INET6;
|
||||
break;
|
||||
case ADDR_TYPE_DNS:
|
||||
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
|
||||
if (use_proxy) /* hand it to the proxy */
|
||||
break;
|
||||
if (!use_dns) /* ignore DNS when we can't use it */
|
||||
@@ -1025,6 +1028,7 @@ static void try_connect_one_addr(struct connecting *connect)
|
||||
addr = &connect->addrs[connect->addrnum];
|
||||
}
|
||||
freeaddrinfo(ais);
|
||||
#endif
|
||||
goto next;
|
||||
case ADDR_TYPE_WEBSOCKET:
|
||||
af = -1;
|
||||
@@ -1666,8 +1670,10 @@ static void add_seed_addrs(struct wireaddr_internal **addrs,
|
||||
NULL, broken_reply, NULL);
|
||||
if (new_addrs) {
|
||||
for (size_t j = 0; j < tal_count(new_addrs); j++) {
|
||||
#if EXPERIMENTAL_FEATURES /* BOLT7 DNS RFC #911 */
|
||||
if (new_addrs[j].type == ADDR_TYPE_DNS)
|
||||
continue;
|
||||
#endif
|
||||
struct wireaddr_internal a;
|
||||
a.itype = ADDR_INTERNAL_WIREADDR;
|
||||
a.u.wireaddr = new_addrs[j];
|
||||
|
||||
Reference in New Issue
Block a user