core-lightning/gossipd/tor.h
Rusty Russell 0d23f4fb4a gossipd: hand io_tor_connect the host as a string.
Previously it converted the wireaddr to a string internally: to support
unresolved names we need that done externally.

We actually tell the SOCKS5 proxy to do a domain lookup already, even
though we give use IP/IPv6 address, so this change is sufficient to
support connect-by-name.

Note replacement of assert() with an explicit case statement, which
has the benefit that the compiler complains when we add new
ADDR_INTERNAL types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-05-11 09:15:54 +00:00

17 lines
386 B
C

#ifndef LIGHTNING_GOSSIPD_TOR_H
#define LIGHTNING_GOSSIPD_TOR_H
#include "config.h"
#include <stdbool.h>
struct addrinfo;
struct wireaddr;
struct io_conn;
struct reaching;
struct io_plan *io_tor_connect(struct io_conn *conn,
const struct addrinfo *tor_proxyaddr,
const char *host, u16 port,
struct reaching *reach);
#endif /* LIGHTNING_GOSSIPD_TOR_H */