peer-control: send set of messages to start, not just one

The accepter has to send 2 messages over to channeld to send at start --
their commitment_signatures and tx_signatures
This commit is contained in:
niftynei 2020-09-09 19:40:28 +09:30 committed by Rusty Russell
parent cafdbbcd2d
commit 0643945967
8 changed files with 12 additions and 11 deletions

View File

@ -415,7 +415,7 @@ static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds)
void peer_start_channeld(struct channel *channel,
struct per_peer_state *pps,
const u8 *funding_signed,
const u8 **fwd_msgs,
bool reconnected)
{
u8 *initmsg;
@ -556,7 +556,8 @@ void peer_start_channeld(struct channel *channel,
channel->shutdown_scriptpubkey[REMOTE] != NULL,
channel->shutdown_scriptpubkey[LOCAL],
channel->channel_flags,
funding_signed,
/* FIXME: pass set of msgs */
fwd_msgs ? fwd_msgs[0] : NULL,
reached_announce_depth,
&last_remote_per_commit_secret,
channel->peer->their_features,

View File

@ -12,7 +12,7 @@ struct peer;
void peer_start_channeld(struct channel *channel,
struct per_peer_state *pps,
const u8 *funding_signed,
const u8 **fwd_msgs,
bool reconnected);
/* Returns true if subd told, otherwise false. */

View File

@ -418,7 +418,7 @@ static void opening_fundee_finished(struct subd *openingd,
const int *fds,
struct uncommitted_channel *uc)
{
u8 *funding_signed;
const u8 *msgs[1];
struct channel_info channel_info;
struct bitcoin_signature remote_commit_sig;
struct bitcoin_tx *remote_commit;
@ -458,7 +458,7 @@ static void opening_fundee_finished(struct subd *openingd,
&push,
&channel_flags,
&feerate,
&funding_signed,
cast_const2(u8 **, msgs),
&uc->our_config.channel_reserve,
&local_upfront_shutdown_script,
&remote_upfront_shutdown_script)) {
@ -516,7 +516,7 @@ static void opening_fundee_finished(struct subd *openingd,
wallet_penalty_base_add(ld->wallet, channel->dbid, pbase);
/* On to normal operation! */
peer_start_channeld(channel, pps, funding_signed, false);
peer_start_channeld(channel, pps, msgs, false);
subd_release_channel(openingd, uc);
uc->open_daemon = NULL;

View File

@ -461,7 +461,7 @@ struct channel *peer_normal_channel(struct peer *peer UNNEEDED)
/* Generated stub for peer_start_channeld */
void peer_start_channeld(struct channel *channel UNNEEDED,
struct per_peer_state *pps UNNEEDED,
const u8 *funding_signed UNNEEDED,
const u8 **fwd_msgs UNNEEDED,
bool reconnected UNNEEDED)
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
/* Generated stub for peer_start_closingd */

View File

@ -1648,4 +1648,4 @@ struct db_query db_postgres_queries[] = {
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
// SHA256STAMP:d9e28ea3b9764c7f3d5cc2bba2ac18493fc00bb42d13e94d0589824512aa1e01
// SHA256STAMP:765807f84044cf41f5bed6300b9bbf280d0828e9d8eae183d832f7d7608a956d

View File

@ -1648,4 +1648,4 @@ struct db_query db_sqlite3_queries[] = {
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
// SHA256STAMP:d9e28ea3b9764c7f3d5cc2bba2ac18493fc00bb42d13e94d0589824512aa1e01
// SHA256STAMP:765807f84044cf41f5bed6300b9bbf280d0828e9d8eae183d832f7d7608a956d

View File

@ -1085,4 +1085,4 @@ msgstr ""
#: wallet/test/run-wallet.c:1345
msgid "INSERT INTO channels (id) VALUES (1);"
msgstr ""
# SHA256STAMP:c4174faa4e7db5644e1fa34f7c891563ec9697b003d415e91ab256b21462c398
# SHA256STAMP:28870591d46cd24796c8d9b30f76ac5dc91840cf1a70111b0e23c814dd5cc411

View File

@ -568,7 +568,7 @@ void peer_memleak_done(struct command *cmd UNNEEDED, struct subd *leaker UNNEEDE
/* Generated stub for peer_start_channeld */
void peer_start_channeld(struct channel *channel UNNEEDED,
struct per_peer_state *pps UNNEEDED,
const u8 *funding_signed UNNEEDED,
const u8 **fwd_msgs UNNEEDED,
bool reconnected UNNEEDED)
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
/* Generated stub for peer_start_closingd */