lightningd: set cid correctly in peer->uncommitted_channel.

Setting it to 0xfffff... is just confusing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-16 14:19:29 +09:30
committed by neil saitug
parent 98185dfc2b
commit 08e3e979c8
4 changed files with 6 additions and 5 deletions

View File

@@ -1142,6 +1142,8 @@ static struct command_result *json_fundchannel_start(struct command *cmd,
return command_fail(cmd, FUNDING_PEER_NOT_CONNECTED,
"Peer not connected");
temporary_channel_id(&tmp_channel_id);
if (!peer->uncommitted_channel) {
if (feature_negotiated(cmd->ld->our_features,
peer->their_features,
@@ -1168,6 +1170,8 @@ static struct command_result *json_fundchannel_start(struct command *cmd,
"peer");
}
peer->uncommitted_channel->cid = tmp_channel_id;
/* BOLT #2:
* - if both nodes advertised `option_support_large_channel`:
* - MAY set `funding_satoshis` greater than or equal to 2^24 satoshi.
@@ -1220,8 +1224,6 @@ static struct command_result *json_fundchannel_start(struct command *cmd,
} else
upfront_shutdown_script_wallet_index = NULL;
temporary_channel_id(&tmp_channel_id);
fc->open_msg
= towire_openingd_funder_start(fc,
*amount,