lightningd: allow 'style' 'legacy' for clboss compat (with deprecated_apis).

We keep the parameter around for future use (e.g. PTLC support?), but clboss
master still sets 'style' to "legacy".  Accept, but ignore it.

Reported-by: grubman on #c-lightning (IRC)
Changelog-Deprecated: JSON-RPC: `sendpay` `route` argument `style` "legacy" (don't use it at all, we ignore it now and always use "tlv" anyway).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-03-23 10:30:06 +10:30
parent 5aa108f176
commit f7aba31448
5 changed files with 7 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
#include "config.h"
#include <ccan/tal/str/str.h>
#include <common/bolt12_merkle.h>
#include <common/configdir.h>
#include <common/json_command.h>
#include <common/json_helpers.h>
#include <common/json_tok.h>
@@ -1331,6 +1332,10 @@ static struct command_result *param_route_hop_style(struct command *cmd,
return NULL;
}
/* We still let you *specify* this, but we ignore it! */
if (deprecated_apis && json_tok_streq(buffer, tok, "legacy"))
return NULL;
return command_fail_badparam(cmd, name, buffer, tok,
"should be 'tlv' ('legacy' not supported)");
}