Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1829,30 +1829,6 @@ static void connect_activate(struct daemon *daemon, const u8 *msg)
take(towire_connectd_activate_reply(NULL, errmsg)));
}

/* BOLT #10:
*
* The DNS seed:
* ...
* - upon receiving a _node_ query:
* - MUST select the record matching the `node_id`, if any, AND return all
* addresses associated with that node.
*/
static const char **seednames(const tal_t *ctx, const struct node_id *id)
{
char bech32[100];
u5 *data = tal_arr(ctx, u5, 0);
const char **seednames = tal_arr(ctx, const char *, 0);

bech32_push_bits(&data, id->k, ARRAY_SIZE(id->k)*8);
bech32_encode(bech32, "ln", data, tal_count(data), sizeof(bech32),
BECH32_ENCODING_BECH32);
/* This is cdecker's seed */
tal_arr_expand(&seednames, tal_fmt(seednames, "%s.lseed.bitcoinstats.com", bech32));
/* This is darosior's seed */
tal_arr_expand(&seednames, tal_fmt(seednames, "%s.lseed.darosior.ninja", bech32));
return seednames;
}

static bool addr_in(const struct wireaddr_internal *needle,
const struct wireaddr_internal haystack[])
{
Expand All @@ -1869,7 +1845,6 @@ static void try_connect_peer(struct daemon *daemon,
struct wireaddr_internal *addrs TAKES,
const char *reason TAKES)
{
bool use_proxy = daemon->always_use_proxy;
struct connecting *connect;
struct peer *peer;

Expand Down Expand Up @@ -1897,22 +1872,6 @@ static void try_connect_peer(struct daemon *daemon,
return;
}

if (tal_count(addrs) == 0) {
/* Don't resolve via DNS seed if we're supposed to use proxy. */
if (use_proxy) {
/* You're allowed to use names with proxies; in fact it's
* a good idea. */
struct wireaddr_internal unresolved;
const char **hostnames = seednames(tmpctx, id);
for (size_t i = 0; i < tal_count(hostnames); i++) {
wireaddr_from_unresolved(&unresolved,
hostnames[i],
chainparams_get_ln_port(chainparams));
tal_arr_expand(&addrs, unresolved);
}
}
}

/* Still no address? Fail immediately. Important ones get
* retried; an address may get gossiped. */
if (tal_count(addrs) == 0) {
Expand Down
Loading