From 081ef05dd1c889f6dd94b5fedd66bf29e74d60c9 Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 13 Jan 2022 16:35:29 -0600 Subject: [PATCH] listchannels: add funding_outnum to listchannels Changelog-Added: JSONRPC: `listchannels` now includes the `funding_outnum` --- doc/lightning-listpeers.7.md | 3 ++- doc/schemas/listpeers.schema.json | 8 ++++++++ lightningd/peer_control.c | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md index f3ff7e96b..17a48d81f 100644 --- a/doc/lightning-listpeers.7.md +++ b/doc/lightning-listpeers.7.md @@ -55,6 +55,7 @@ On success, an object containing **peers** is returned. It is an array of objec - **short_channel_id** (short_channel_id, optional): The short_channel_id (once locked in) - **channel_id** (hex, optional): The full channel_id (always 64 characters) - **funding_txid** (txid, optional): ID of the funding transaction + - **funding_outnum** (u32, optional): The 0-based output number of the funding transaction which opens the channel - **initial_feerate** (string, optional): For inflight opens, the first feerate used to initiate the channel open - **last_feerate** (string, optional): For inflight opens, the most recent feerate used on the channel open - **next_feerate** (string, optional): For inflight opens, the next feerate we'll use for the channel open @@ -376,4 +377,4 @@ Main web site: Lightning RFC site (BOLT \#9): -[comment]: # ( SHA256STAMP:956a13291bebc808bf1505a5d2030280aca441c5ca9991a6baae70c8715429a4) +[comment]: # ( SHA256STAMP:444080f602bbce7d86bc7c38a4a2b1186a31c63d6b747d92c5aa4711dd9118c1) diff --git a/doc/schemas/listpeers.schema.json b/doc/schemas/listpeers.schema.json index 1a37fd2bc..74a7f782e 100644 --- a/doc/schemas/listpeers.schema.json +++ b/doc/schemas/listpeers.schema.json @@ -235,6 +235,10 @@ "type": "txid", "description": "ID of the funding transaction" }, + "funding_outnum": { + "type": "u32", + "description": "The 0-based output number of the funding transaction which opens the channel" + }, "initial_feerate": { "type": "string", "description": "For inflight opens, the first feerate used to initiate the channel open" @@ -741,6 +745,7 @@ "short_channel_id": {}, "channel_id": {}, "funding_txid": {}, + "funding_outnum": {}, "close_to": {}, "private": {}, "opener": {}, @@ -826,6 +831,7 @@ "short_channel_id": {}, "channel_id": {}, "funding_txid": {}, + "funding_outnum": {}, "inflight": {}, "close_to": {}, "private": {}, @@ -913,6 +919,7 @@ "short_channel_id": {}, "channel_id": {}, "funding_txid": {}, + "funding_outnum": {}, "inflight": {}, "close_to": {}, "private": {}, @@ -1000,6 +1007,7 @@ "short_channel_id": {}, "channel_id": {}, "funding_txid": {}, + "funding_outnum": {}, "close_to": {}, "private": {}, "opener": {}, diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index e87d0ae8b..ca309f119 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -656,6 +656,7 @@ static void json_add_channel(struct lightningd *ld, json_add_string(response, "channel_id", type_to_string(tmpctx, struct channel_id, &channel->cid)); json_add_txid(response, "funding_txid", &channel->funding.txid); + json_add_num(response, "funding_outnum", channel->funding.n); if (!list_empty(&channel->inflights)) { struct channel_inflight *initial, *inflight;