lightningd: always tell connectd the channel id.

This means lightningd needs to create the temporary one and tell it to
openingd/dualopend, rather than the other way around.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-03-23 06:57:30 +10:30
parent 57263a3eb2
commit 2bc58e2327
8 changed files with 24 additions and 12 deletions

View File

@@ -79,7 +79,7 @@ msgdata,connectd_peer_disconnect_done,id,node_id,
# Master -> connectd: make peer active immediately (we want to talk)
msgtype,connectd_peer_make_active,2004
msgdata,connectd_peer_make_active,id,node_id,
msgdata,connectd_peer_make_active,channel_id,?channel_id,
msgdata,connectd_peer_make_active,channel_id,channel_id,
# Connectd -> master: peer said something interesting (or you said make_active)
# Plus fd for peer daemon.
1 #include <bitcoin/block.h>
79 # master -> connectd: peer no longer wanted, you can disconnect.
80 msgtype,connectd_discard_peer,2015
81 msgdata,connectd_discard_peer,id,node_id,
82 # master -> connectd: give message to peer and disconnect.
83 msgtype,connectd_peer_final_msg,2003
84 msgdata,connectd_peer_final_msg,id,node_id,
85 msgdata,connectd_peer_final_msg,len,u16,

View File

@@ -440,9 +440,9 @@ void peer_make_active(struct daemon *daemon, const u8 *msg)
{
struct node_id id;
struct peer *peer;
struct channel_id *channel_id;
struct channel_id channel_id;
if (!fromwire_connectd_peer_make_active(msg, msg, &id, &channel_id))
if (!fromwire_connectd_peer_make_active(msg, &id, &channel_id))
master_badmsg(WIRE_CONNECTD_PEER_MAKE_ACTIVE, msg);
/* Races can happen: this might be gone by now. */
@@ -458,7 +458,7 @@ void peer_make_active(struct daemon *daemon, const u8 *msg)
if (tal_count(peer->subds) != 0)
return;
if (!activate_peer(peer, NULL, channel_id))
if (!activate_peer(peer, NULL, &channel_id))
tal_free(peer);
}