From c4cbb8671a5fe864a7ccbfd360fecb62a4ddb7e5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 17 Nov 2024 14:31:05 +1030 Subject: [PATCH] lightningd: actually deprecate old close fields. Changelog-Deprecated: `close` `tx` and `txid` field (use `txs` and `txids`) Signed-off-by: Rusty Russell --- contrib/msggen/msggen/schema.json | 2 -- doc/developers-guide/deprecations.md | 2 ++ doc/schemas/lightning-close.json | 2 -- lightningd/closing_control.c | 6 ++++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 096ca00b3d1e..6b065ba3b4aa 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -5599,8 +5599,6 @@ "then": { "additionalProperties": false, "required": [ - "tx", - "txid", "txs", "txids" ], diff --git a/doc/developers-guide/deprecations.md b/doc/developers-guide/deprecations.md index 19252aa92591..4239951d3ede 100644 --- a/doc/developers-guide/deprecations.md +++ b/doc/developers-guide/deprecations.md @@ -34,6 +34,8 @@ hidden: false | decode.blinding | Field | v24.11 | v25.05 | Renamed to `first_path_key` in BOLT 4 (available in `decode` from v24.11) | | onion_message_recv.blinding | Hook Field | v24.11 | v25.05 | Renamed to `first_path_key` in BOLT 4 (available in hook from v24.11) | | decodepay | Command | v24.11 | v25.11 | Use `decode` which is more powerful (since v23.05) | +| close.tx | Field | v24.11 | v25.11 | Use txs array instead | +| close.txid | Field | v24.11 | v25.11 | Use txids array instead | Inevitably there are features which need to change: either to be generalized, or removed when they can no longer be supported. diff --git a/doc/schemas/lightning-close.json b/doc/schemas/lightning-close.json index 850b5493ea29..a440546cdc19 100644 --- a/doc/schemas/lightning-close.json +++ b/doc/schemas/lightning-close.json @@ -106,8 +106,6 @@ "then": { "additionalProperties": false, "required": [ - "tx", - "txid", "txs", "txids" ], diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index 5567f583ae61..b143159647bf 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -58,11 +58,13 @@ resolve_one_close_command(struct close_command *cc, bool cooperative, struct json_stream *result = json_stream_success(cc->cmd); const struct bitcoin_tx *close_tx = close_txs[tal_count(close_txs) - 1]; - json_add_tx(result, "tx", close_tx); + if (command_deprecated_out_ok(cc->cmd, "tx", "v24.11", "v25.11")) + json_add_tx(result, "tx", close_tx); if (!invalid_last_tx(close_tx)) { struct bitcoin_txid txid; bitcoin_txid(close_tx, &txid); - json_add_txid(result, "txid", &txid); + if (command_deprecated_out_ok(cc->cmd, "txid", "v24.11", "v25.11")) + json_add_txid(result, "txid", &txid); } json_array_start(result, "txs");