mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
mpp: Add CLI option to opt-out of multi-part payments
Several tests are not well-suited for mpp, so I added a CLI option to opt-out of the MPP support at startup time.
This commit is contained in:
@@ -862,6 +862,27 @@ char *u32_option(const char *arg, u32 *i)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *bool_option(const char *arg, bool *i)
|
||||
{
|
||||
if (!streq(arg, "true") && !streq(arg, "false"))
|
||||
return tal_fmt(NULL, "'%s' is not a bool, must be \"true\" or \"false\"", arg);
|
||||
|
||||
*i = streq(arg, "true");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *flag_option(const char *arg, bool *i)
|
||||
{
|
||||
/* We only get called if the flag was provided, so *i should be false
|
||||
* by default */
|
||||
assert(*i == false);
|
||||
if (!streq(arg, "true"))
|
||||
return tal_fmt(NULL, "Invalid argument '%s' passed to a flag", arg);
|
||||
|
||||
*i = true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *charp_option(const char *arg, char **p)
|
||||
{
|
||||
*p = tal_strdup(NULL, arg);
|
||||
|
||||
Reference in New Issue
Block a user