funder: sanitize inputs

Error out if we've got the wrong info
This commit is contained in:
niftynei
2021-04-22 16:33:08 -05:00
committed by Rusty Russell
parent bc7875864b
commit 6b37b92f8a
3 changed files with 35 additions and 0 deletions

View File

@@ -593,8 +593,14 @@ static void json_channel_open_failed(struct command *cmd,
static const char *init(struct plugin *p, const char *b, const jsmntok_t *t)
{
const char *err;
list_head_init(&pending_opens);
err = funder_check_policy(&current_policy);
if (err)
plugin_err(p, "Invalid parameter combination: %s", err);
return NULL;
}