lightningd: remove tx and txid fields from close response.

Changelog-Removed: JSON-RPC: `close` `tx` and `txid` field (use `txs` and `txids`), deprecated v24.11.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2026-01-20 14:56:27 +10:30
parent 592f8586f4
commit 983146791a
9 changed files with 1083 additions and 1155 deletions

View File

@@ -547,8 +547,6 @@ message CloseResponse {
UNOPENED = 2;
}
CloseType item_type = 1;
optional bytes tx = 2;
optional bytes txid = 3;
repeated bytes txs = 4;
repeated bytes txids = 5;
}

View File

@@ -449,14 +449,10 @@ impl From<responses::CheckmessageResponse> for pb::CheckmessageResponse {
}
}
#[allow(unused_variables,deprecated)]
#[allow(unused_variables)]
impl From<responses::CloseResponse> for pb::CloseResponse {
fn from(c: responses::CloseResponse) -> Self {
Self {
#[allow(deprecated)]
tx: c.tx.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
#[allow(deprecated)]
txid: c.txid.map(|v| hex::decode(v).unwrap()), // Rule #2 for type txid?
// Field: Close.txids[]
txids: c.txids.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
// Field: Close.txs[]

6
cln-rpc/src/model.rs generated
View File

@@ -5814,12 +5814,6 @@ pub mod responses {
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CloseResponse {
#[deprecated]
#[serde(skip_serializing_if = "Option::is_none")]
pub tx: Option<String>,
#[deprecated]
#[serde(skip_serializing_if = "Option::is_none")]
pub txid: Option<String>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub txids: Option<Vec<String>>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]

View File

@@ -5908,26 +5908,6 @@
],
"properties": {
"type": {},
"tx": {
"type": "hex",
"deprecated": [
"v24.11",
"v25.12"
],
"description": [
"The raw bitcoin transaction used to close the channel (if it was open)."
]
},
"txid": {
"type": "txid",
"deprecated": [
"v24.11",
"v25.12"
],
"description": [
"The transaction id of the *tx* field."
]
},
"txs": {
"added": "v24.11",
"type": "array",

File diff suppressed because one or more lines are too long

View File

@@ -335,8 +335,6 @@ def close2py(m):
"txids": [hexlify(m.txids) for i in hexlify(m.txids)], # ArrayField[primitive] in generate_composite
"txs": [hexlify(m.txs) for i in hexlify(m.txs)], # ArrayField[primitive] in generate_composite
"type": str(m.item_type), # EnumField in generate_composite
"tx": hexlify(m.tx), # PrimitiveField in generate_composite
"txid": hexlify(m.txid), # PrimitiveField in generate_composite
})

View File

@@ -9,8 +9,6 @@ privacy:
| Name | Type | First Deprecated | Last Supported | Description |
|----------------------------------------------------|--------------------|------------------|----------------|---------------------------------------------------------------------------------------------------------------------------|
| close.tx | Field | v24.11 | v25.12 | Use txs array instead |
| close.txid | Field | v24.11 | v25.12 | Use txids array instead |
| xpay.ignore_bolt12_mpp | Field | v25.05 | v25.12 | Try MPP even if the BOLT12 invoice doesn't explicitly allow it (CLN didn't until 25.02) |
| listpeerchannels.max_total_htlc_in_msat | Field | v25.02 | v26.03 | Use our_max_total_htlc_out_msat |
| wait.details | Field | v25.05 | v26.06 | Use subsystem-specific object instead |

View File

@@ -111,26 +111,6 @@
],
"properties": {
"type": {},
"tx": {
"type": "hex",
"deprecated": [
"v24.11",
"v25.12"
],
"description": [
"The raw bitcoin transaction used to close the channel (if it was open)."
]
},
"txid": {
"type": "txid",
"deprecated": [
"v24.11",
"v25.12"
],
"description": [
"The transaction id of the *tx* field."
]
},
"txs": {
"added": "v24.11",
"type": "array",

View File

@@ -39,22 +39,6 @@ resolve_one_close_command(struct close_command *cc, bool cooperative,
const struct bitcoin_tx **close_txs)
{
struct json_stream *result = json_stream_success(cc->cmd);
const struct bitcoin_tx *close_tx;
/* Withheld funding channels can have no close_txs! */
if (tal_count(close_txs) != 0)
close_tx = close_txs[tal_count(close_txs) - 1];
else
close_tx = NULL;
if (close_tx && command_deprecated_out_ok(cc->cmd, "tx", "v24.11", "v25.12"))
json_add_tx(result, "tx", close_tx);
if (close_tx && !invalid_last_tx(close_tx)) {
struct bitcoin_txid txid;
bitcoin_txid(close_tx, &txid);
if (command_deprecated_out_ok(cc->cmd, "txid", "v24.11", "v25.12"))
json_add_txid(result, "txid", &txid);
}
json_array_start(result, "txs");
for (int i = 0; i < tal_count(close_txs); i++)