From 099acb2a66346fc54802c96e6bd431c2806f8b00 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Fri, 16 Mar 2018 23:37:02 +0000 Subject: [PATCH] opening_control: have fundchannel also return channel_id. For voyeurism. --- lightningd/opening_control.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index dae8cb77c682..eb87ebcd6935 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* Channel we're still opening. */ @@ -245,6 +246,7 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp, struct channel *channel; struct json_result *response; struct lightningd *ld = openingd->ld; + struct channel_id cid; assert(tal_count(fds) == 2); @@ -384,6 +386,9 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp, linear = linearize_tx(response, fundingtx); json_add_hex(response, "tx", linear, tal_len(linear)); json_add_txid(response, "txid", &channel->funding_txid); + derive_channel_id(&cid, &channel->funding_txid, funding_outnum); + json_add_string(response, "channel_id", + type_to_string(tmpctx, struct channel_id, &cid)); json_object_end(response); command_success(fc->cmd, response);