lightningd: rename --no-reconnect to --dev-no-reconnect.

It's a dev option.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-01-29 11:00:15 +10:30
committed by Christian Decker
parent bd3480dc9c
commit 0600aac68f
5 changed files with 18 additions and 21 deletions

View File

@@ -47,6 +47,8 @@ static struct lightningd *new_lightningd(const tal_t *ctx,
ld->dev_disconnect_fd = -1;
ld->dev_hsm_seed = NULL;
ld->dev_subdaemon_fail = false;
ld->no_reconnect = false;
if (getenv("LIGHTNINGD_DEV_MEMLEAK"))
memleak_init(ld, backtrace_state);
#endif

View File

@@ -66,9 +66,6 @@ struct config {
/* How often to broadcast gossip (msec) */
u32 broadcast_interval;
/* Disable automatic reconnects */
bool no_reconnect;
/* Channel update interval */
u32 channel_update_interval;
@@ -152,6 +149,9 @@ struct lightningd {
/* Things we've marked as not leaking. */
const void **notleaks;
/* Disable automatic reconnects */
bool no_reconnect;
#endif /* DEVELOPER */
};

View File

@@ -262,9 +262,6 @@ 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_add_ipaddr, NULL,
ld,
"Set the IP address (v4 or v6) to announce to the network for incoming connections");
@@ -291,6 +288,9 @@ static char *opt_set_hsm_seed(const char *arg, struct lightningd *ld)
static void dev_register_opts(struct lightningd *ld)
{
opt_register_noarg("--dev-no-reconnect", opt_set_bool,
&ld->no_reconnect,
"Disable automatic reconnect attempts");
opt_register_noarg("--dev-no-broadcast", opt_set_bool,
&ld->topology->dev_no_broadcast, opt_hidden);
opt_register_noarg("--dev-fail-on-subdaemon-fail", opt_set_bool,
@@ -352,9 +352,6 @@ static const struct config testnet_config = {
* Each node SHOULD flush outgoing announcements once every 60 seconds */
.broadcast_interval = 60000,
/* Automatically reconnect */
.no_reconnect = false,
/* Send a keepalive update at least every week, prune every twice that */
.channel_update_interval = 1209600/2,
@@ -416,9 +413,6 @@ static const struct config mainnet_config = {
* Each node SHOULD flush outgoing announcements once every 60 seconds */
.broadcast_interval = 60000,
/* Automatically reconnect */
.no_reconnect = false,
/* Send a keepalive update at least every week, prune every twice that */
.channel_update_interval = 1209600/2,

View File

@@ -267,11 +267,12 @@ void peer_fail_transient(struct peer *peer, const char *fmt, ...)
/* Reconnect unless we've dropped/are dropping to chain. */
if (!peer_on_chain(peer) && peer->state != CLOSINGD_COMPLETE) {
#if DEVELOPER
/* Don't schedule an attempt if we disabled reconnections with
* the `--no-reconnect` flag */
if (peer->ld->config.no_reconnect)
* the `--dev-no-reconnect` flag */
if (peer->ld->no_reconnect)
return;
#endif /* DEVELOPER */
u8 *msg = towire_gossipctl_reach_peer(peer, &peer->id);
subd_send_msg(peer->ld->gossip, take(msg));
}