Browse Source

plugins/pay: use feature set from lightningd to decode bolt11.

This means we correctly reject invoices with features we don't understand.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
travis-debug
Rusty Russell 5 years ago
parent
commit
ca512e3cb2
  1. 4
      plugins/pay.c

4
plugins/pay.c

@ -1283,8 +1283,8 @@ static struct command_result *json_pay(struct command *cmd,
NULL)) NULL))
return command_param_failed(); return command_param_failed();
/* FIXME: We need to know our features! */ b11 = bolt11_decode(cmd, b11str, plugin_feature_set(cmd->plugin),
b11 = bolt11_decode(cmd, b11str, NULL, NULL, &fail); NULL, &fail);
if (!b11) { if (!b11) {
return command_fail(cmd, JSONRPC2_INVALID_PARAMS, return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"Invalid bolt11: %s", fail); "Invalid bolt11: %s", fail);

Loading…
Cancel
Save