From ec8bba6b8aa36acdfa145e0b085a795ebeb584cc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 1 Jun 2023 16:12:43 +0930 Subject: [PATCH] dev-allowdustreserve: make this a DEVELOPER option. Otherwise, we should rename it? Signed-off-by: Rusty Russell --- lightningd/options.c | 9 ++++----- tests/test_opening.py | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lightningd/options.c b/lightningd/options.c index f9e9ff131..d3c8b54c0 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -861,6 +861,10 @@ static void dev_register_opts(struct lightningd *ld) "own. Small values will cause channels to be" " closed more often due to fee fluctuations," " large values may result in large fees."); + opt_register_arg("--dev-allowdustreserve", opt_set_bool_arg, opt_show_bool, + &ld->config.allowdustreserve, + "If true, we allow the `fundchannel` RPC command and the `openchannel` plugin hook to set a reserve that is below the dust limit."); + } #endif /* DEVELOPER */ @@ -1354,11 +1358,6 @@ static void register_opts(struct lightningd *ld) opt_register_arg("--autolisten", opt_set_bool_arg, opt_show_bool, &ld->autolisten, "If true, listen on default port and announce if it seems to be a public interface"); - - opt_register_arg("--dev-allowdustreserve", opt_set_bool_arg, opt_show_bool, - &ld->config.allowdustreserve, - "If true, we allow the `fundchannel` RPC command and the `openchannel` plugin hook to set a reserve that is below the dust limit."); - opt_register_arg("--proxy", opt_add_proxy_addr, NULL, ld,"Set a socks v5 proxy IP address and port"); opt_register_arg("--tor-service-password", opt_set_talstr, NULL, diff --git a/tests/test_opening.py b/tests/test_opening.py index 622224f9e..11fc51c33 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -1812,6 +1812,7 @@ def test_zeroconf_multichan_forward(node_factory): .format(normal_scid, zeroconf_scid)) +@pytest.mark.developer("dev-allowdustreserve") def test_zeroreserve(node_factory, bitcoind): """Ensure we can set the reserves. @@ -1891,6 +1892,7 @@ def test_zeroreserve(node_factory, bitcoind): assert len(decoded['vout']) == 1 if TEST_NETWORK == 'regtest' else 2 +@pytest.mark.developer("dev-allowdustreserve") def test_zeroreserve_mixed(node_factory, bitcoind): """l1 runs with zeroreserve, l2 and l3 without, should still work @@ -1921,6 +1923,7 @@ def test_zeroreserve_mixed(node_factory, bitcoind): l3.rpc.fundchannel(l1.info['id'], 10**6) +@pytest.mark.developer("dev-allowdustreserve") def test_zeroreserve_alldust(node_factory): """If we allow dust reserves we need larger fundings