channel: Passing channel_flags through to channeld

This commit is contained in:
Christian Decker 2017-06-29 16:02:37 +02:00 committed by Rusty Russell
parent ac1172c7b0
commit 02aba77698
3 changed files with 8 additions and 2 deletions

View File

@ -130,6 +130,7 @@ struct peer {
bool last_was_revoke;
struct changed_htlc *last_sent_commit;
u64 revocations_received;
u8 channel_flags;
};
static u8 *create_channel_announcement(const tal_t *ctx, struct peer *peer);
@ -1657,6 +1658,7 @@ static void init_channel(struct peer *peer)
&peer->short_channel_ids[LOCAL],
&reconnected,
&peer->unsent_shutdown_scriptpubkey,
&peer->channel_flags,
&funding_signed))
status_failed(WIRE_CHANNEL_BAD_COMMAND, "Init: %s",
tal_hex(msg, msg));
@ -1745,8 +1747,10 @@ static void handle_funding_locked(struct peer *peer, const u8 *msg)
static void handle_funding_announce_depth(struct peer *peer, const u8 *msg)
{
status_trace("Exchanging announcement signatures.");
send_announcement_signatures(peer);
if (peer->channel_flags & CHANNEL_FLAGS_ANNOUNCE_CHANNEL) {
status_trace("Exchanging announcement signatures.");
send_announcement_signatures(peer);
}
/* Only send the announcement and update if the other end gave
* us its sig */

View File

@ -66,6 +66,7 @@ channel_init,,funding_short_id,struct short_channel_id
channel_init,,reestablish,bool
channel_init,,shutdown_scriptpubkey_len,u16
channel_init,,shutdown_scriptpubkey,shutdown_scriptpubkey_len*u8
channel_init,,flags,u8
channel_init,,init_peer_pkt_len,u16
channel_init,,init_peer_pkt,init_peer_pkt_len*u8

1 # Shouldn't happen
66 # Tx is deep enough, go! channel_init,,init_peer_pkt,init_peer_pkt_len*u8
67 channel_funding_locked,2 # Tx is deep enough, go!
68 channel_funding_locked,,short_channel_id,struct short_channel_id channel_funding_locked,2
69 channel_funding_locked,,short_channel_id,struct short_channel_id
70 # Tell the channel that we may announce the channel's existence
71 channel_funding_announce_depth,3
72 # Tell channel to offer this htlc

View File

@ -1227,6 +1227,7 @@ static bool peer_start_channeld(struct peer *peer,
&funding_channel_id,
peer->reconnected,
shutdown_scriptpubkey,
peer->channel_flags,
funding_signed);
/* We don't expect a response: we are triggered by funding_depth_cb. */