Skip to content

Commit

Permalink
lightningd: actually deprecate old close fields.
Browse files Browse the repository at this point in the history
Changelog-Deprecated: `close` `tx` and `txid` field (use `txs` and `txids`)
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Nov 17, 2024
1 parent c79a89d commit c4cbb86
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5599,8 +5599,6 @@
"then": {
"additionalProperties": false,
"required": [
"tx",
"txid",
"txs",
"txids"
],
Expand Down
2 changes: 2 additions & 0 deletions doc/developers-guide/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 0 additions & 2 deletions doc/schemas/lightning-close.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
"then": {
"additionalProperties": false,
"required": [
"tx",
"txid",
"txs",
"txids"
],
Expand Down
6 changes: 4 additions & 2 deletions lightningd/closing_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c4cbb86

Please sign in to comment.