Skip to content

Commit da357ab

Browse files
committed
connectd: remove DNS seeds entirely.
For 25.05 (0a94f3b) we removed DNS lookups, but we left them for the corner case where a proxy is used. darosior points out that his is no longer functional, which brought my attention to this vestigial corner case. Changelog-None: we said we'd removed them earlier! Reported-by: darosior Closes: #8968 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent b7c05f6 commit da357ab

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

connectd/connectd.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,30 +1829,6 @@ static void connect_activate(struct daemon *daemon, const u8 *msg)
18291829
take(towire_connectd_activate_reply(NULL, errmsg)));
18301830
}
18311831

1832-
/* BOLT #10:
1833-
*
1834-
* The DNS seed:
1835-
* ...
1836-
* - upon receiving a _node_ query:
1837-
* - MUST select the record matching the `node_id`, if any, AND return all
1838-
* addresses associated with that node.
1839-
*/
1840-
static const char **seednames(const tal_t *ctx, const struct node_id *id)
1841-
{
1842-
char bech32[100];
1843-
u5 *data = tal_arr(ctx, u5, 0);
1844-
const char **seednames = tal_arr(ctx, const char *, 0);
1845-
1846-
bech32_push_bits(&data, id->k, ARRAY_SIZE(id->k)*8);
1847-
bech32_encode(bech32, "ln", data, tal_count(data), sizeof(bech32),
1848-
BECH32_ENCODING_BECH32);
1849-
/* This is cdecker's seed */
1850-
tal_arr_expand(&seednames, tal_fmt(seednames, "%s.lseed.bitcoinstats.com", bech32));
1851-
/* This is darosior's seed */
1852-
tal_arr_expand(&seednames, tal_fmt(seednames, "%s.lseed.darosior.ninja", bech32));
1853-
return seednames;
1854-
}
1855-
18561832
static bool addr_in(const struct wireaddr_internal *needle,
18571833
const struct wireaddr_internal haystack[])
18581834
{
@@ -1897,22 +1873,6 @@ static void try_connect_peer(struct daemon *daemon,
18971873
return;
18981874
}
18991875

1900-
if (tal_count(addrs) == 0) {
1901-
/* Don't resolve via DNS seed if we're supposed to use proxy. */
1902-
if (use_proxy) {
1903-
/* You're allowed to use names with proxies; in fact it's
1904-
* a good idea. */
1905-
struct wireaddr_internal unresolved;
1906-
const char **hostnames = seednames(tmpctx, id);
1907-
for (size_t i = 0; i < tal_count(hostnames); i++) {
1908-
wireaddr_from_unresolved(&unresolved,
1909-
hostnames[i],
1910-
chainparams_get_ln_port(chainparams));
1911-
tal_arr_expand(&addrs, unresolved);
1912-
}
1913-
}
1914-
}
1915-
19161876
/* Still no address? Fail immediately. Important ones get
19171877
* retried; an address may get gossiped. */
19181878
if (tal_count(addrs) == 0) {

0 commit comments

Comments
 (0)