mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
libplugin: make set callback for options take plugin ptr, check correct type.
I added a plugin arg and was surprised that compile didn't break. This is because typesafe_cb et al are conditional casts: if the type isn't as expected it has no effect, but we're passing plugin_option() through varargs, so everything is accepted! Add a noop inline to check type, and fix up the two cases where we used `const char *` instead of `char *`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "config.h"
|
||||
#include <common/amount.h>
|
||||
|
||||
struct plugin;
|
||||
struct lease_rates;
|
||||
struct node_id;
|
||||
|
||||
@@ -93,7 +94,7 @@ const char *funder_policy_desc(const tal_t *ctx,
|
||||
const struct funder_policy *policy);
|
||||
|
||||
/* Convert a cmdline option to a funding_opt */
|
||||
char *funding_option(const char *arg, enum funder_opt *opt);
|
||||
char *funding_option(struct plugin *plugin, const char *arg, enum funder_opt *opt);
|
||||
|
||||
/* Check policy settings, return error if fails */
|
||||
char *funder_check_policy(const struct funder_policy *policy);
|
||||
|
||||
Reference in New Issue
Block a user