opts: deprecate --disable-ip-discovery switch

This switch was not doing anything useful anymore.
We deprecate it anyways to notify the user about the new switch.

Changelog-Deprecated: The old --disable-ip-discovery config switch
This commit is contained in:
Michael Schmoock
2022-12-20 18:28:46 +01:00
parent a2b94f16f8
commit 30dea0a431
6 changed files with 14 additions and 21 deletions

View File

@@ -88,7 +88,7 @@ On success, an object is returned, containing:
- **autolisten** (boolean, optional): `autolisten` field from config or cmdline, or default - **autolisten** (boolean, optional): `autolisten` field from config or cmdline, or default
- **proxy** (string, optional): `proxy` field from config or cmdline, or default - **proxy** (string, optional): `proxy` field from config or cmdline, or default
- **disable-dns** (boolean, optional): `true` if `disable-dns` was set in config or cmdline - **disable-dns** (boolean, optional): `true` if `disable-dns` was set in config or cmdline
- **disable-ip-discovery** (boolean, optional): `true` if `disable-ip-discovery` was set in config or cmdline (DEPRECATED) - **disable-ip-discovery** (boolean, optional): `true` if `disable-ip-discovery` was set in config or cmdline **deprecated, removal in v23.11**
- **announce-addr-discovered** (string, optional): `true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline *(added v23.02)* - **announce-addr-discovered** (string, optional): `true`/`false`/`auto` depending on how `announce-addr-discovered` was set in config or cmdline *(added v23.02)*
- **encrypted-hsm** (boolean, optional): `true` if `encrypted-hsm` was set in config or cmdline - **encrypted-hsm** (boolean, optional): `true` if `encrypted-hsm` was set in config or cmdline
- **rpc-file-mode** (string, optional): `rpc-file-mode` field from config or cmdline, or default - **rpc-file-mode** (string, optional): `rpc-file-mode` field from config or cmdline, or default
@@ -221,4 +221,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning> Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:fcf5e537989d9df2cf2031ff6b7589cc1d6acc30a81806e7ecedb3265b8c9b3b) [comment]: # ( SHA256STAMP:9953b3545acb82bed816b86a65ba51ff4b043d3848c4a3ae460aa68db1a4b542)

View File

@@ -368,14 +368,6 @@ use the RPC call lightning-setchannel(7).
Note: You also need to open TCP port 9735 on your router towords your node. Note: You also need to open TCP port 9735 on your router towords your node.
Note: Will always be disabled if you use 'always-use-proxy'. Note: Will always be disabled if you use 'always-use-proxy'.
* **disable-ip-discovery**
Turn off public IP discovery to send `node_announcement` updates that contain
the discovered IP with TCP port 9735 as announced address. If unset and you
open TCP port 9735 on your router towords your node, your node will remain
connectable on changing IP addresses. Note: Will always be disabled if you use
'always-use-proxy'.
### Lightning channel and HTLC options ### Lightning channel and HTLC options
* **large-channels** * **large-channels**

View File

@@ -245,7 +245,8 @@
}, },
"disable-ip-discovery": { "disable-ip-discovery": {
"type": "boolean", "type": "boolean",
"description": "`true` if `disable-ip-discovery` was set in config or cmdline" "description": "`true` if `disable-ip-discovery` was set in config or cmdline",
"deprecated": "v23.02"
}, },
"announce-addr-discovered": { "announce-addr-discovered": {
"type": "string", "type": "string",

View File

@@ -61,8 +61,6 @@ struct config {
/* Excplicitly turns 'on' or 'off' IP discovery feature. */ /* Excplicitly turns 'on' or 'off' IP discovery feature. */
enum opt_autobool ip_discovery; enum opt_autobool ip_discovery;
/* Turn off IP address announcement discovered via peer `remote_addr` */
bool disable_ip_discovery;
/* Minimal amount of effective funding_satoshis for accepting channels */ /* Minimal amount of effective funding_satoshis for accepting channels */
u64 min_capacity_sat; u64 min_capacity_sat;

View File

@@ -845,8 +845,6 @@ static const struct config testnet_config = {
/* Excplicitly turns 'on' or 'off' IP discovery feature. */ /* Excplicitly turns 'on' or 'off' IP discovery feature. */
.ip_discovery = OPT_AUTOBOOL_AUTO, .ip_discovery = OPT_AUTOBOOL_AUTO,
/* Turn off IP address announcement discovered via peer `remote_addr` */
.disable_ip_discovery = false,
/* Sets min_effective_htlc_capacity - at 1000$/BTC this is 10ct */ /* Sets min_effective_htlc_capacity - at 1000$/BTC this is 10ct */
.min_capacity_sat = 10000, .min_capacity_sat = 10000,
@@ -913,8 +911,6 @@ static const struct config mainnet_config = {
/* Excplicitly turns 'on' or 'off' IP discovery feature. */ /* Excplicitly turns 'on' or 'off' IP discovery feature. */
.ip_discovery = OPT_AUTOBOOL_AUTO, .ip_discovery = OPT_AUTOBOOL_AUTO,
/* Turn off IP address announcement discovered via peer `remote_addr` */
.disable_ip_discovery = false,
/* Sets min_effective_htlc_capacity - at 1000$/BTC this is 10ct */ /* Sets min_effective_htlc_capacity - at 1000$/BTC this is 10ct */
.min_capacity_sat = 10000, .min_capacity_sat = 10000,
@@ -1084,6 +1080,13 @@ static char *opt_set_db_upgrade(const char *arg, struct lightningd *ld)
return opt_set_bool_arg(arg, ld->db_upgrade_ok); return opt_set_bool_arg(arg, ld->db_upgrade_ok);
} }
static char *opt_disable_ip_discovery(struct lightningd *ld)
{
log_broken(ld->log, "--disable-ip-discovery has been deprecated, use --announce-addr-discovered=false");
ld->config.ip_discovery = OPT_AUTOBOOL_FALSE;
return NULL;
}
static void register_opts(struct lightningd *ld) static void register_opts(struct lightningd *ld)
{ {
/* This happens before plugins started */ /* This happens before plugins started */
@@ -1216,9 +1219,7 @@ static void register_opts(struct lightningd *ld)
ld, ld,
"Set an IP address (v4 or v6) or .onion v3 to announce, but not listen on"); "Set an IP address (v4 or v6) or .onion v3 to announce, but not listen on");
opt_register_noarg("--disable-ip-discovery", opt_set_bool, opt_register_noarg("--disable-ip-discovery", opt_disable_ip_discovery, ld, opt_hidden);
&ld->config.disable_ip_discovery,
"Turn off announcement of discovered public IPs");
opt_register_arg("--announce-addr-discovered", opt_set_autobool_arg, opt_show_autobool, opt_register_arg("--announce-addr-discovered", opt_set_autobool_arg, opt_show_autobool,
&ld->config.ip_discovery, &ld->config.ip_discovery,
"Explicitly turns IP discovery 'on' or 'off'."); "Explicitly turns IP discovery 'on' or 'off'.");

View File

@@ -1308,7 +1308,8 @@ static void update_remote_addr(struct lightningd *ld,
u16 public_port; u16 public_port;
/* failsafe to prevent privacy leakage. */ /* failsafe to prevent privacy leakage. */
if (ld->always_use_proxy || ld->config.disable_ip_discovery) if (ld->always_use_proxy ||
ld->config.ip_discovery == OPT_AUTOBOOL_FALSE)
return; return;
/* Peers will have likey reported our dynamic outbound TCP port. /* Peers will have likey reported our dynamic outbound TCP port.