opening: pass two messages to channeld to send to peer

v2 of channel establishment, in the accpeter case, now sends 2 messages
to our peer after saving the information to disk (our commitment
signatures and our funding transaction signatures)
This commit is contained in:
niftynei 2020-09-09 19:40:28 +09:30 committed by Rusty Russell
parent 0643945967
commit d6558deaa4
13 changed files with 43 additions and 26 deletions

View File

@ -3205,7 +3205,7 @@ static void init_channel(struct peer *peer)
enum side opener; enum side opener;
struct existing_htlc **htlcs; struct existing_htlc **htlcs;
bool reconnected; bool reconnected;
u8 *funding_signed; u8 *fwd_msg_1, *fwd_msg_2;
const u8 *msg; const u8 *msg;
struct fee_states *fee_states; struct fee_states *fee_states;
u32 minimum_depth; u32 minimum_depth;
@ -3266,7 +3266,8 @@ static void init_channel(struct peer *peer)
&peer->shutdown_sent[REMOTE], &peer->shutdown_sent[REMOTE],
&peer->final_scriptpubkey, &peer->final_scriptpubkey,
&peer->channel_flags, &peer->channel_flags,
&funding_signed, &fwd_msg_1,
&fwd_msg_2,
&peer->announce_depth_reached, &peer->announce_depth_reached,
&last_remote_per_commit_secret, &last_remote_per_commit_secret,
&peer->their_features, &peer->their_features,
@ -3368,9 +3369,11 @@ static void init_channel(struct peer *peer)
if (reconnected) if (reconnected)
peer_reconnect(peer, &last_remote_per_commit_secret); peer_reconnect(peer, &last_remote_per_commit_secret);
/* If we have a funding_signed message, send that immediately */ /* If we have a messages to send, send them immediately */
if (funding_signed) if (fwd_msg_1)
sync_crypto_write(peer->pps, take(funding_signed)); sync_crypto_write(peer->pps, take(fwd_msg_1));
if (fwd_msg_2)
sync_crypto_write(peer->pps, take(fwd_msg_2));
/* Reenable channel */ /* Reenable channel */
channel_announcement_negotiate(peer); channel_announcement_negotiate(peer);

View File

@ -57,6 +57,8 @@ msgdata,channeld_init,final_scriptpubkey,u8,final_scriptpubkey_len
msgdata,channeld_init,flags,u8, msgdata,channeld_init,flags,u8,
msgdata,channeld_init,init_peer_pkt_len,u16, msgdata,channeld_init,init_peer_pkt_len,u16,
msgdata,channeld_init,init_peer_pkt,u8,init_peer_pkt_len msgdata,channeld_init,init_peer_pkt,u8,init_peer_pkt_len
msgdata,channeld_init,init_peer_pkt_two_len,u16,
msgdata,channeld_init,init_peer_pkt_two,u8,init_peer_pkt_two_len
msgdata,channeld_init,reached_announce_depth,bool, msgdata,channeld_init,reached_announce_depth,bool,
msgdata,channeld_init,last_remote_secret,secret, msgdata,channeld_init,last_remote_secret,secret,
msgdata,channeld_init,flen,u16, msgdata,channeld_init,flen,u16,

1 #include <common/cryptomsg.h>
57 msgdata,channeld_init,init_peer_pkt_len,u16,
58 msgdata,channeld_init,init_peer_pkt,u8,init_peer_pkt_len
59 msgdata,channeld_init,reached_announce_depth,bool, msgdata,channeld_init,init_peer_pkt_two_len,u16,
60 msgdata,channeld_init,init_peer_pkt_two,u8,init_peer_pkt_two_len
61 msgdata,channeld_init,reached_announce_depth,bool,
62 msgdata,channeld_init,last_remote_secret,secret,
63 msgdata,channeld_init,flen,u16,
64 msgdata,channeld_init,their_features,u8,flen

View File

@ -98,12 +98,13 @@ bool channeld_wire_is_defined(u16 type)
/* WIRE: CHANNELD_INIT */ /* WIRE: CHANNELD_INIT */
/* Begin! (passes gossipd-client fd) */ /* Begin! (passes gossipd-client fd) */
u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases) u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, const u8 *init_peer_pkt_two, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases)
{ {
u16 num_last_sent_commit = tal_count(last_sent_commit); u16 num_last_sent_commit = tal_count(last_sent_commit);
u16 num_existing_htlcs = tal_count(htlcs); u16 num_existing_htlcs = tal_count(htlcs);
u16 final_scriptpubkey_len = tal_count(final_scriptpubkey); u16 final_scriptpubkey_len = tal_count(final_scriptpubkey);
u16 init_peer_pkt_len = tal_count(init_peer_pkt); u16 init_peer_pkt_len = tal_count(init_peer_pkt);
u16 init_peer_pkt_two_len = tal_count(init_peer_pkt_two);
u16 flen = tal_count(their_features); u16 flen = tal_count(their_features);
u16 upfront_shutdown_script_len = tal_count(upfront_shutdown_script); u16 upfront_shutdown_script_len = tal_count(upfront_shutdown_script);
u32 num_penalty_bases = tal_count(pbases); u32 num_penalty_bases = tal_count(pbases);
@ -161,6 +162,8 @@ u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams
towire_u8(&p, flags); towire_u8(&p, flags);
towire_u16(&p, init_peer_pkt_len); towire_u16(&p, init_peer_pkt_len);
towire_u8_array(&p, init_peer_pkt, init_peer_pkt_len); towire_u8_array(&p, init_peer_pkt, init_peer_pkt_len);
towire_u16(&p, init_peer_pkt_two_len);
towire_u8_array(&p, init_peer_pkt_two, init_peer_pkt_two_len);
towire_bool(&p, reached_announce_depth); towire_bool(&p, reached_announce_depth);
towire_secret(&p, last_remote_secret); towire_secret(&p, last_remote_secret);
towire_u16(&p, flen); towire_u16(&p, flen);
@ -189,12 +192,13 @@ u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams
return memcheck(p, tal_count(p)); return memcheck(p, tal_count(p));
} }
bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases) bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, u8 **init_peer_pkt_two, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases)
{ {
u16 num_last_sent_commit; u16 num_last_sent_commit;
u16 num_existing_htlcs; u16 num_existing_htlcs;
u16 final_scriptpubkey_len; u16 final_scriptpubkey_len;
u16 init_peer_pkt_len; u16 init_peer_pkt_len;
u16 init_peer_pkt_two_len;
u16 flen; u16 flen;
u16 upfront_shutdown_script_len; u16 upfront_shutdown_script_len;
u32 num_penalty_bases; u32 num_penalty_bases;
@ -263,6 +267,10 @@ bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainp
// 2nd case init_peer_pkt // 2nd case init_peer_pkt
*init_peer_pkt = init_peer_pkt_len ? tal_arr(ctx, u8, init_peer_pkt_len) : NULL; *init_peer_pkt = init_peer_pkt_len ? tal_arr(ctx, u8, init_peer_pkt_len) : NULL;
fromwire_u8_array(&cursor, &plen, *init_peer_pkt, init_peer_pkt_len); fromwire_u8_array(&cursor, &plen, *init_peer_pkt, init_peer_pkt_len);
init_peer_pkt_two_len = fromwire_u16(&cursor, &plen);
// 2nd case init_peer_pkt_two
*init_peer_pkt_two = init_peer_pkt_two_len ? tal_arr(ctx, u8, init_peer_pkt_two_len) : NULL;
fromwire_u8_array(&cursor, &plen, *init_peer_pkt_two, init_peer_pkt_two_len);
*reached_announce_depth = fromwire_bool(&cursor, &plen); *reached_announce_depth = fromwire_bool(&cursor, &plen);
fromwire_secret(&cursor, &plen, last_remote_secret); fromwire_secret(&cursor, &plen, last_remote_secret);
flen = fromwire_u16(&cursor, &plen); flen = fromwire_u16(&cursor, &plen);
@ -1186,4 +1194,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str
} }
return cursor != NULL; return cursor != NULL;
} }
// SHA256STAMP:b2694c40c2801c4f6d4c49be6f6eee583bac168a96d6bb2bac6a845744d3cbee // SHA256STAMP:aa250e4a173c88e28c650c42e93a348013575efd29427de6b779e72f2802a413

View File

@ -89,8 +89,8 @@ bool channeld_wire_is_defined(u16 type);
/* WIRE: CHANNELD_INIT */ /* WIRE: CHANNELD_INIT */
/* Begin! (passes gossipd-client fd) */ /* Begin! (passes gossipd-client fd) */
u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases); u8 *towire_channeld_init(const tal_t *ctx, const struct chainparams *chainparams, const struct feature_set *our_features, const struct channel_id *channel_id, const struct bitcoin_txid *funding_txid, u16 funding_txout, struct amount_sat funding_satoshi, u32 minimum_depth, const struct channel_config *our_config, const struct channel_config *their_config, const struct fee_states *fee_states, u32 feerate_min, u32 feerate_max, u32 feerate_penalty, const struct bitcoin_signature *first_commit_sig, const struct per_peer_state *per_peer_state, const struct pubkey *remote_fundingkey, const struct basepoints *remote_basepoints, const struct pubkey *remote_per_commit, const struct pubkey *old_remote_per_commit, enum side opener, u32 fee_base, u32 fee_proportional, struct amount_msat local_msatoshi, const struct basepoints *our_basepoints, const struct pubkey *our_funding_pubkey, const struct node_id *local_node_id, const struct node_id *remote_node_id, u32 commit_msec, u16 cltv_delta, bool last_was_revoke, const struct changed_htlc *last_sent_commit, u64 next_index_local, u64 next_index_remote, u64 revocations_received, u64 next_htlc_id, const struct existing_htlc **htlcs, bool local_funding_locked, bool remote_funding_locked, const struct short_channel_id *funding_short_id, bool reestablish, bool send_shutdown, bool remote_shutdown_received, const u8 *final_scriptpubkey, u8 flags, const u8 *init_peer_pkt, const u8 *init_peer_pkt_two, bool reached_announce_depth, const struct secret *last_remote_secret, const u8 *their_features, const u8 *upfront_shutdown_script, const secp256k1_ecdsa_signature *remote_ann_node_sig, const secp256k1_ecdsa_signature *remote_ann_bitcoin_sig, bool option_static_remotekey, bool option_anchor_outputs, bool dev_fast_gossip, bool dev_fail_process_onionpacket, const struct penalty_base *pbases);
bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases); bool fromwire_channeld_init(const tal_t *ctx, const void *p, const struct chainparams **chainparams, struct feature_set **our_features, struct channel_id *channel_id, struct bitcoin_txid *funding_txid, u16 *funding_txout, struct amount_sat *funding_satoshi, u32 *minimum_depth, struct channel_config *our_config, struct channel_config *their_config, struct fee_states **fee_states, u32 *feerate_min, u32 *feerate_max, u32 *feerate_penalty, struct bitcoin_signature *first_commit_sig, struct per_peer_state **per_peer_state, struct pubkey *remote_fundingkey, struct basepoints *remote_basepoints, struct pubkey *remote_per_commit, struct pubkey *old_remote_per_commit, enum side *opener, u32 *fee_base, u32 *fee_proportional, struct amount_msat *local_msatoshi, struct basepoints *our_basepoints, struct pubkey *our_funding_pubkey, struct node_id *local_node_id, struct node_id *remote_node_id, u32 *commit_msec, u16 *cltv_delta, bool *last_was_revoke, struct changed_htlc **last_sent_commit, u64 *next_index_local, u64 *next_index_remote, u64 *revocations_received, u64 *next_htlc_id, struct existing_htlc ***htlcs, bool *local_funding_locked, bool *remote_funding_locked, struct short_channel_id *funding_short_id, bool *reestablish, bool *send_shutdown, bool *remote_shutdown_received, u8 **final_scriptpubkey, u8 *flags, u8 **init_peer_pkt, u8 **init_peer_pkt_two, bool *reached_announce_depth, struct secret *last_remote_secret, u8 **their_features, u8 **upfront_shutdown_script, secp256k1_ecdsa_signature **remote_ann_node_sig, secp256k1_ecdsa_signature **remote_ann_bitcoin_sig, bool *option_static_remotekey, bool *option_anchor_outputs, bool *dev_fast_gossip, bool *dev_fail_process_onionpacket, struct penalty_base **pbases);
/* WIRE: CHANNELD_FUNDING_DEPTH */ /* WIRE: CHANNELD_FUNDING_DEPTH */
/* master->channeld funding hit new depth(funding locked if >= lock depth) */ /* master->channeld funding hit new depth(funding locked if >= lock depth) */
@ -230,4 +230,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str
#endif /* LIGHTNING_CHANNELD_CHANNELD_WIREGEN_H */ #endif /* LIGHTNING_CHANNELD_CHANNELD_WIREGEN_H */
// SHA256STAMP:b2694c40c2801c4f6d4c49be6f6eee583bac168a96d6bb2bac6a845744d3cbee // SHA256STAMP:aa250e4a173c88e28c650c42e93a348013575efd29427de6b779e72f2802a413

View File

@ -415,7 +415,8 @@ 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 **fwd_msgs, const u8 *fwd_msg_1,
const u8 *fwd_msg_2,
bool reconnected) bool reconnected)
{ {
u8 *initmsg; u8 *initmsg;
@ -556,8 +557,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,
/* FIXME: pass set of msgs */ fwd_msg_1,
fwd_msgs ? fwd_msgs[0] : NULL, fwd_msg_2,
reached_announce_depth, reached_announce_depth,
&last_remote_per_commit_secret, &last_remote_per_commit_secret,
channel->peer->their_features, channel->peer->their_features,

View File

@ -12,7 +12,8 @@ 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 **fwd_msgs, const u8 *fwd_msg_1,
const u8 *fwd_msg_2,
bool reconnected); bool reconnected);
/* Returns true if subd told, otherwise false. */ /* Returns true if subd told, otherwise false. */

View File

@ -404,7 +404,7 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp,
wallet_penalty_base_add(ld->wallet, channel->dbid, pbase); wallet_penalty_base_add(ld->wallet, channel->dbid, pbase);
funding_success(channel); funding_success(channel);
peer_start_channeld(channel, pps, NULL, false); peer_start_channeld(channel, pps, NULL, NULL, false);
cleanup: cleanup:
subd_release_channel(openingd, fc->uc); subd_release_channel(openingd, fc->uc);
@ -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)
{ {
const u8 *msgs[1]; const u8 *fwd_msg;
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,
cast_const2(u8 **, msgs), cast_const2(u8 **, &fwd_msg),
&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, msgs, false); peer_start_channeld(channel, pps, fwd_msg, NULL, false);
subd_release_channel(openingd, uc); subd_release_channel(openingd, uc);
uc->open_daemon = NULL; uc->open_daemon = NULL;

View File

@ -981,7 +981,7 @@ peer_connected_hook_cb(struct peer_connected_hook_payload *payload STEALS,
assert(!channel->owner); assert(!channel->owner);
channel->peer->addr = addr; channel->peer->addr = addr;
peer_start_channeld(channel, payload->pps, NULL, peer_start_channeld(channel, payload->pps, NULL, NULL,
true); true);
tal_free(payload); tal_free(payload);
return; return;

View File

@ -461,7 +461,8 @@ 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 **fwd_msgs UNNEEDED, const u8 *fwd_msg_1 UNNEEDED,
const u8 *fwd_msg_2 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 */

View File

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

View File

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

View File

@ -1082,7 +1082,7 @@ msgstr ""
msgid "not a valid SQL statement" msgid "not a valid SQL statement"
msgstr "" msgstr ""
#: wallet/test/run-wallet.c:1345 #: wallet/test/run-wallet.c:1346
msgid "INSERT INTO channels (id) VALUES (1);" msgid "INSERT INTO channels (id) VALUES (1);"
msgstr "" msgstr ""
# SHA256STAMP:28870591d46cd24796c8d9b30f76ac5dc91840cf1a70111b0e23c814dd5cc411 # SHA256STAMP:b38439695ca8ff636fbd7b7b17d156d5d5d5408b8d5dd228d20744b7e25da2be

View File

@ -568,7 +568,8 @@ 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 **fwd_msgs UNNEEDED, const u8 *fwd_msg_1 UNNEEDED,
const u8 *fwd_msg_2 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 */