From cdf803cd6f84b0ec32afcce0e95ecf74017d97aa Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 14 Mar 2023 06:18:38 +1030 Subject: [PATCH] plugins/pay: revert removal of paying invoice without description. It's still deprecated: we need the description since 1. This information is useful for any validation we want to do, such as the HSM, or runes. 2. We want this information in listpays so we can tell what we actually paid. 3. In general, we should never sign commitments to things we don't have! I expect to have this information about payments *whatever the frontend* is, which is why we deprecated (and then removed) this unintended use. The spec is pretty clear on this: BOLT #11: ``` A reader: ... - MUST check that the SHA2 256-bit hash in the `h` field exactly matches the hashed description. ``` However, neither BTCPayServer nor lnbits updated despite the long deprecation period, so revert 2afe7a1856b04177898e2dea6b1050d4c8477d87. Signed-off-by: Rusty Russell --- plugins/pay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pay.c b/plugins/pay.c index 268e4fca1..91f3d77e0 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1067,7 +1067,7 @@ static struct command_result *json_pay(struct command *cmd, * - MUST check that the SHA2 256-bit hash in the `h` field * exactly matches the hashed description. */ - if (!b11->description) { + if (!b11->description && !deprecated_apis) { if (!b11->description_hash) { return command_fail(cmd, JSONRPC2_INVALID_PARAMS,