Browse Source

opts: Add option to disable DNS lookups

Mainly used to disable `gossipd` reaching out to the DNS seeds during testing.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
1bfa02d877
  1. 17
      doc/lightningd-config.5
  2. 7
      doc/lightningd-config.5.txt
  3. 3
      lightningd/lightningd.h
  4. 7
      lightningd/options.c

17
doc/lightningd-config.5

@ -2,12 +2,12 @@
.\" Title: lightningd-config
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 05/10/2018
.\" Date: 06/20/2018
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LIGHTNINGD\-CONFIG" "5" "05/10/2018" "\ \&" "\ \&"
.TH "LIGHTNINGD\-CONFIG" "5" "06/20/2018" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -203,14 +203,16 @@ How long to wait before sending commitment messages to the peer: in theory incre
.sp
Lightning channel and HTLC options:
.PP
\fBlocktime\-blocks\fR=\fIBLOCKS\fR
\fBwatchtime\-blocks\fR=\fIBLOCKS\fR
.RS 4
How long we need to spot an outdated close attempt, which is also how long the peer would need to wait if they perform a unilateral close\&.
How long we need to spot an outdated close attempt: on opening a channel we tell our peer that this is how long they\(cqll have to wait if they perform a unilateral close\&.
.RE
.PP
\fBmax\-locktime\-blocks\fR=\fIBLOCKS\fR
.RS 4
The longest we\(cqll ever allow a peer to hold up payments, in the worst case\&. If they ask for longer, we\(cqll refuse to create a channel, and if an HTLC asks for longer, we\(cqll refuse it\&.
The longest our funds can be delayed (ie\&. the longest
\fBwatchtime\-blocks\fR
our peer can ask for, and also the longest HTLC timeout we will accept)\&. If our peer asks for longer, we\(cqll refuse to create a channel, and if an HTLC asks for longer, we\(cqll refuse it\&.
.RE
.PP
\fBfunding\-confirms\fR=\fIBLOCKS\fR
@ -408,6 +410,11 @@ Always use the
\fBproxy\fR, even to connect to normal IP addresses (you can still connect to Unix domain sockets manually)\&. This also disables all DNS lookups, to avoid leaking information\&.
.RE
.PP
\fBdisable\-dns\fR
.RS 4
Disable the DNS bootstrapping mechanism to find a node by its node ID\&.
.RE
.PP
\fBtor\-service\-password\fR=\fIPASSWORD\fR
.RS 4
Set a Tor control password, which may be needed for

7
doc/lightningd-config.5.txt

@ -100,7 +100,7 @@ Lightning daemon options:
*pid-file*='PATH'::
Specify pid file to write to.
*log-level*='LEVEL'::
What log level to print out: options are io, debug, info, unusual, broken.
@ -278,10 +278,13 @@ or precisely control where to bind and what to announce with the
can still connect to Unix domain sockets manually). This also disables
all DNS lookups, to avoid leaking information.
*disable-dns*::
Disable the DNS bootstrapping mechanism to find a node by its node ID.
*tor-service-password*='PASSWORD'::
Set a Tor control password, which may be needed for 'autotor:' to
authenticate to the Tor control port.
BUGS
----
You should report bugs on our github issues page, and maybe submit a

3
lightningd/lightningd.h

@ -64,6 +64,9 @@ struct config {
/* Accept fee changes only if they are in the range our_fee -
* our_fee*multiplier */
u32 max_fee_multiplier;
/* Are we allowed to use DNS lookup for peers. */
bool use_dns;
};
struct lightningd {

7
lightningd/options.c

@ -409,6 +409,9 @@ static void config_register_opts(struct lightningd *ld)
opt_set_bool_arg, opt_show_bool,
&ld->use_proxy_always, "Use the proxy always");
opt_register_noarg("--disable-dns", opt_set_invbool, &ld->config.use_dns,
"Disable DNS lookups of peers");
#if DEVELOPER
opt_register_arg("--dev-max-funding-unconfirmed-blocks",
opt_set_u32, opt_show_u32,
@ -529,6 +532,8 @@ static const struct config testnet_config = {
/* Fees may be in the range our_fee - 10*our_fee */
.max_fee_multiplier = 10,
.use_dns = true,
};
/* aka. "Dude, where's my coins?" */
@ -590,6 +595,8 @@ static const struct config mainnet_config = {
/* Fees may be in the range our_fee - 10*our_fee */
.max_fee_multiplier = 10,
.use_dns = true,
};
static void check_config(struct lightningd *ld)

Loading…
Cancel
Save