Skip to content

Commit c4cbb86

Browse files
committed
lightningd: actually deprecate old close fields.
Changelog-Deprecated: `close` `tx` and `txid` field (use `txs` and `txids`) Signed-off-by: Rusty Russell <[email protected]>
1 parent c79a89d commit c4cbb86

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

contrib/msggen/msggen/schema.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5599,8 +5599,6 @@
55995599
"then": {
56005600
"additionalProperties": false,
56015601
"required": [
5602-
"tx",
5603-
"txid",
56045602
"txs",
56055603
"txids"
56065604
],

doc/developers-guide/deprecations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ hidden: false
3434
| decode.blinding | Field | v24.11 | v25.05 | Renamed to `first_path_key` in BOLT 4 (available in `decode` from v24.11) |
3535
| onion_message_recv.blinding | Hook Field | v24.11 | v25.05 | Renamed to `first_path_key` in BOLT 4 (available in hook from v24.11) |
3636
| decodepay | Command | v24.11 | v25.11 | Use `decode` which is more powerful (since v23.05) |
37+
| close.tx | Field | v24.11 | v25.11 | Use txs array instead |
38+
| close.txid | Field | v24.11 | v25.11 | Use txids array instead |
3739

3840
Inevitably there are features which need to change: either to be generalized, or removed when they can no longer be supported.
3941

doc/schemas/lightning-close.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@
106106
"then": {
107107
"additionalProperties": false,
108108
"required": [
109-
"tx",
110-
"txid",
111109
"txs",
112110
"txids"
113111
],

lightningd/closing_control.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ resolve_one_close_command(struct close_command *cc, bool cooperative,
5858
struct json_stream *result = json_stream_success(cc->cmd);
5959
const struct bitcoin_tx *close_tx = close_txs[tal_count(close_txs) - 1];
6060

61-
json_add_tx(result, "tx", close_tx);
61+
if (command_deprecated_out_ok(cc->cmd, "tx", "v24.11", "v25.11"))
62+
json_add_tx(result, "tx", close_tx);
6263
if (!invalid_last_tx(close_tx)) {
6364
struct bitcoin_txid txid;
6465
bitcoin_txid(close_tx, &txid);
65-
json_add_txid(result, "txid", &txid);
66+
if (command_deprecated_out_ok(cc->cmd, "txid", "v24.11", "v25.11"))
67+
json_add_txid(result, "txid", &txid);
6668
}
6769

6870
json_array_start(result, "txs");

0 commit comments

Comments
 (0)