MCPcopy Create free account
hub / github.com/ElementsProject/lightning / seednames

Function seednames

connectd/connectd.c:1594–1608  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

1592 * addresses associated with that node.
1593 */
1594static const char **seednames(const tal_t *ctx, const struct node_id *id)
1595{
1596 char bech32[100];
1597 u5 *data = tal_arr(ctx, u5, 0);
1598 const char **seednames = tal_arr(ctx, const char *, 0);
1599
1600 bech32_push_bits(&data, id->k, ARRAY_SIZE(id->k)*8);
1601 bech32_encode(bech32, "ln", data, tal_count(data), sizeof(bech32),
1602 BECH32_ENCODING_BECH32);
1603 /* This is cdecker's seed */
1604 tal_arr_expand(&seednames, tal_fmt(seednames, "%s.lseed.bitcoinstats.com", bech32));
1605 /* This is darosior's seed */
1606 tal_arr_expand(&seednames, tal_fmt(seednames, "%s.lseed.darosior.ninja", bech32));
1607 return seednames;
1608}
1609
1610/*~ As a last resort, we do a DNS lookup to the lightning DNS seed to
1611 * resolve a node name when they say to connect to it. This is synchronous,

Callers 2

add_seed_addrsFunction · 0.85
try_connect_peerFunction · 0.85

Calls 2

bech32_push_bitsFunction · 0.85
bech32_encodeFunction · 0.50

Tested by

no test coverage detected