mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
lightningd: fix parsing of option dev-force-features
It did not pick-up the last (bolt11) bits set.
This commit is contained in:
parent
905a85dc99
commit
9bbb52097e
@ -611,11 +611,11 @@ static char *opt_force_featureset(const char *optarg,
|
|||||||
struct lightningd *ld)
|
struct lightningd *ld)
|
||||||
{
|
{
|
||||||
char **parts = tal_strsplit(tmpctx, optarg, "/", STR_EMPTY_OK);
|
char **parts = tal_strsplit(tmpctx, optarg, "/", STR_EMPTY_OK);
|
||||||
if (tal_count(parts) != NUM_FEATURE_PLACE) {
|
if (tal_count(parts) != NUM_FEATURE_PLACE + 1) {
|
||||||
if (!strstarts(optarg, "-") && !strstarts(optarg, "+"))
|
if (!strstarts(optarg, "-") && !strstarts(optarg, "+"))
|
||||||
return "Expected 5 feature sets (init, globalinit,"
|
return "Expected 5 feature sets (init/globalinit/"
|
||||||
" node_announce, channel, bolt11) separated"
|
" node_announce/channel/bolt11) each terminated by /"
|
||||||
" by / OR +/-<feature_num>";
|
" OR +/-<single_bit_num>";
|
||||||
|
|
||||||
char *endp;
|
char *endp;
|
||||||
long int n = strtol(optarg + 1, &endp, 10);
|
long int n = strtol(optarg + 1, &endp, 10);
|
||||||
@ -712,7 +712,7 @@ static void dev_register_opts(struct lightningd *ld)
|
|||||||
&ld->plugins->dev_builtin_plugins_unimportant,
|
&ld->plugins->dev_builtin_plugins_unimportant,
|
||||||
"Make builtin plugins unimportant so you can plugin stop them.");
|
"Make builtin plugins unimportant so you can plugin stop them.");
|
||||||
opt_register_arg("--dev-force-features", opt_force_featureset, NULL, ld,
|
opt_register_arg("--dev-force-features", opt_force_featureset, NULL, ld,
|
||||||
"Force the init/globalinit/node_announce/channel/bolt11 features, each comma-separated bitnumbers");
|
"Force the init/globalinit/node_announce/channel/bolt11/ features, each comma-separated bitnumbers OR a single +/-<bitnumber>");
|
||||||
opt_register_arg("--dev-timeout-secs", opt_set_u32, opt_show_u32,
|
opt_register_arg("--dev-timeout-secs", opt_set_u32, opt_show_u32,
|
||||||
&ld->config.connection_timeout_secs,
|
&ld->config.connection_timeout_secs,
|
||||||
"Seconds to timeout if we don't receive INIT from peer");
|
"Seconds to timeout if we don't receive INIT from peer");
|
||||||
|
@ -3226,7 +3226,7 @@ def test_nonstatic_channel(node_factory, bitcoind):
|
|||||||
opts=[{},
|
opts=[{},
|
||||||
# needs at least 15 to connect
|
# needs at least 15 to connect
|
||||||
# (and 9 is a dependent)
|
# (and 9 is a dependent)
|
||||||
{'dev-force-features': '9,15////'}])
|
{'dev-force-features': '9,15/////'}])
|
||||||
chan = only_one(only_one(l1.rpc.listpeers()['peers'])['channels'])
|
chan = only_one(only_one(l1.rpc.listpeers()['peers'])['channels'])
|
||||||
assert 'option_static_remotekey' not in chan['features']
|
assert 'option_static_remotekey' not in chan['features']
|
||||||
assert 'option_anchor_outputs' not in chan['features']
|
assert 'option_anchor_outputs' not in chan['features']
|
||||||
|
Loading…
Reference in New Issue
Block a user