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:
parent
cafdbbcd2d
commit
0643945967
|
@ -415,7 +415,7 @@ static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds)
|
||||||
|
|
||||||
void peer_start_channeld(struct channel *channel,
|
void peer_start_channeld(struct channel *channel,
|
||||||
struct per_peer_state *pps,
|
struct per_peer_state *pps,
|
||||||
const u8 *funding_signed,
|
const u8 **fwd_msgs,
|
||||||
bool reconnected)
|
bool reconnected)
|
||||||
{
|
{
|
||||||
u8 *initmsg;
|
u8 *initmsg;
|
||||||
|
@ -556,7 +556,8 @@ void peer_start_channeld(struct channel *channel,
|
||||||
channel->shutdown_scriptpubkey[REMOTE] != NULL,
|
channel->shutdown_scriptpubkey[REMOTE] != NULL,
|
||||||
channel->shutdown_scriptpubkey[LOCAL],
|
channel->shutdown_scriptpubkey[LOCAL],
|
||||||
channel->channel_flags,
|
channel->channel_flags,
|
||||||
funding_signed,
|
/* FIXME: pass set of msgs */
|
||||||
|
fwd_msgs ? fwd_msgs[0] : NULL,
|
||||||
reached_announce_depth,
|
reached_announce_depth,
|
||||||
&last_remote_per_commit_secret,
|
&last_remote_per_commit_secret,
|
||||||
channel->peer->their_features,
|
channel->peer->their_features,
|
||||||
|
|
|
@ -12,7 +12,7 @@ struct peer;
|
||||||
|
|
||||||
void peer_start_channeld(struct channel *channel,
|
void peer_start_channeld(struct channel *channel,
|
||||||
struct per_peer_state *pps,
|
struct per_peer_state *pps,
|
||||||
const u8 *funding_signed,
|
const u8 **fwd_msgs,
|
||||||
bool reconnected);
|
bool reconnected);
|
||||||
|
|
||||||
/* Returns true if subd told, otherwise false. */
|
/* Returns true if subd told, otherwise false. */
|
||||||
|
|
|
@ -418,7 +418,7 @@ static void opening_fundee_finished(struct subd *openingd,
|
||||||
const int *fds,
|
const int *fds,
|
||||||
struct uncommitted_channel *uc)
|
struct uncommitted_channel *uc)
|
||||||
{
|
{
|
||||||
u8 *funding_signed;
|
const u8 *msgs[1];
|
||||||
struct channel_info channel_info;
|
struct channel_info channel_info;
|
||||||
struct bitcoin_signature remote_commit_sig;
|
struct bitcoin_signature remote_commit_sig;
|
||||||
struct bitcoin_tx *remote_commit;
|
struct bitcoin_tx *remote_commit;
|
||||||
|
@ -458,7 +458,7 @@ static void opening_fundee_finished(struct subd *openingd,
|
||||||
&push,
|
&push,
|
||||||
&channel_flags,
|
&channel_flags,
|
||||||
&feerate,
|
&feerate,
|
||||||
&funding_signed,
|
cast_const2(u8 **, msgs),
|
||||||
&uc->our_config.channel_reserve,
|
&uc->our_config.channel_reserve,
|
||||||
&local_upfront_shutdown_script,
|
&local_upfront_shutdown_script,
|
||||||
&remote_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);
|
wallet_penalty_base_add(ld->wallet, channel->dbid, pbase);
|
||||||
|
|
||||||
/* On to normal operation! */
|
/* On to normal operation! */
|
||||||
peer_start_channeld(channel, pps, funding_signed, false);
|
peer_start_channeld(channel, pps, msgs, false);
|
||||||
|
|
||||||
subd_release_channel(openingd, uc);
|
subd_release_channel(openingd, uc);
|
||||||
uc->open_daemon = NULL;
|
uc->open_daemon = NULL;
|
||||||
|
|
|
@ -461,7 +461,7 @@ struct channel *peer_normal_channel(struct peer *peer UNNEEDED)
|
||||||
/* Generated stub for peer_start_channeld */
|
/* Generated stub for peer_start_channeld */
|
||||||
void peer_start_channeld(struct channel *channel UNNEEDED,
|
void peer_start_channeld(struct channel *channel UNNEEDED,
|
||||||
struct per_peer_state *pps UNNEEDED,
|
struct per_peer_state *pps UNNEEDED,
|
||||||
const u8 *funding_signed UNNEEDED,
|
const u8 **fwd_msgs UNNEEDED,
|
||||||
bool reconnected UNNEEDED)
|
bool reconnected UNNEEDED)
|
||||||
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
|
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
|
||||||
/* Generated stub for peer_start_closingd */
|
/* Generated stub for peer_start_closingd */
|
||||||
|
|
|
@ -1648,4 +1648,4 @@ struct db_query db_postgres_queries[] = {
|
||||||
|
|
||||||
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
|
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
|
||||||
|
|
||||||
// SHA256STAMP:d9e28ea3b9764c7f3d5cc2bba2ac18493fc00bb42d13e94d0589824512aa1e01
|
// SHA256STAMP:765807f84044cf41f5bed6300b9bbf280d0828e9d8eae183d832f7d7608a956d
|
||||||
|
|
|
@ -1648,4 +1648,4 @@ struct db_query db_sqlite3_queries[] = {
|
||||||
|
|
||||||
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
|
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
|
||||||
|
|
||||||
// SHA256STAMP:d9e28ea3b9764c7f3d5cc2bba2ac18493fc00bb42d13e94d0589824512aa1e01
|
// SHA256STAMP:765807f84044cf41f5bed6300b9bbf280d0828e9d8eae183d832f7d7608a956d
|
||||||
|
|
|
@ -1085,4 +1085,4 @@ msgstr ""
|
||||||
#: wallet/test/run-wallet.c:1345
|
#: wallet/test/run-wallet.c:1345
|
||||||
msgid "INSERT INTO channels (id) VALUES (1);"
|
msgid "INSERT INTO channels (id) VALUES (1);"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
# SHA256STAMP:c4174faa4e7db5644e1fa34f7c891563ec9697b003d415e91ab256b21462c398
|
# SHA256STAMP:28870591d46cd24796c8d9b30f76ac5dc91840cf1a70111b0e23c814dd5cc411
|
||||||
|
|
|
@ -568,7 +568,7 @@ void peer_memleak_done(struct command *cmd UNNEEDED, struct subd *leaker UNNEEDE
|
||||||
/* Generated stub for peer_start_channeld */
|
/* Generated stub for peer_start_channeld */
|
||||||
void peer_start_channeld(struct channel *channel UNNEEDED,
|
void peer_start_channeld(struct channel *channel UNNEEDED,
|
||||||
struct per_peer_state *pps UNNEEDED,
|
struct per_peer_state *pps UNNEEDED,
|
||||||
const u8 *funding_signed UNNEEDED,
|
const u8 **fwd_msgs UNNEEDED,
|
||||||
bool reconnected UNNEEDED)
|
bool reconnected UNNEEDED)
|
||||||
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
|
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
|
||||||
/* Generated stub for peer_start_closingd */
|
/* Generated stub for peer_start_closingd */
|
||||||
|
|
Loading…
Reference in New Issue