bolt11: have caller supply preferred chain.

This lets us distinguish testnet from signet invoices, since they
have the same prefix.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-09-23 10:37:19 +09:30
parent 1356700e2b
commit 924cc04bd2
8 changed files with 47 additions and 24 deletions

View File

@@ -1317,7 +1317,7 @@ static struct command_result *json_pay(struct command *cmd,
return command_param_failed();
b11 = bolt11_decode(cmd, b11str, plugin_feature_set(cmd->plugin),
NULL, &fail);
NULL, chainparams, &fail);
if (!b11) {
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"Invalid bolt11: %s", fail);
@@ -1983,7 +1983,7 @@ static struct command_result *json_paymod(struct command *cmd,
return command_param_failed();
b11 = bolt11_decode(cmd, b11str, plugin_feature_set(cmd->plugin),
NULL, &fail);
NULL, chainparams, &fail);
if (!b11)
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"Invalid bolt11: %s", fail);