cli: Add --no-reconnect cli flag

Especially when testing we might want to disable the automatic
reconnection logic in order not to masquerade bugs that disappear when
reconnecting.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2017-10-06 00:02:19 +02:00 committed by Rusty Russell
parent 243fc2c05a
commit 48796f4f39
2 changed files with 11 additions and 0 deletions

View file

@ -64,6 +64,9 @@ struct config {
/* IPv4 or IPv6 address to announce to the network */
struct ipaddr ipaddr;
/* Disable automatic reconnects */
bool no_reconnect;
};
struct lightningd {

View file

@ -224,6 +224,8 @@ static void config_register_opts(struct lightningd *ld)
opt_register_arg("--fee-per-satoshi", opt_set_s32, opt_show_s32,
&ld->config.fee_per_satoshi,
"Microsatoshi fee for every satoshi in HTLC");
opt_register_noarg("--no-reconnect", opt_set_bool,
&ld->config.no_reconnect, "Disable automatic reconnect attempts");
opt_register_arg("--ipaddr", opt_set_ipaddr, NULL,
&ld->config.ipaddr,
@ -298,6 +300,9 @@ static const struct config testnet_config = {
/* Do not advertise any IP */
.ipaddr.type = 0,
/* Automatically reconnect */
.no_reconnect = false,
};
/* aka. "Dude, where's my coins?" */
@ -356,6 +361,9 @@ static const struct config mainnet_config = {
/* Do not advertise any IP */
.ipaddr.type = 0,
/* Automatically reconnect */
.no_reconnect = false,
};
static void check_config(struct lightningd *ld)