Browse Source

channel: Passing channel_flags through to channeld

ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
02aba77698
  1. 4
      lightningd/channel/channel.c
  2. 1
      lightningd/channel/channel_wire.csv
  3. 1
      lightningd/peer_control.c

4
lightningd/channel/channel.c

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

1
lightningd/channel/channel_wire.csv

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

Can't render this file because it has a wrong number of fields in line 2.

1
lightningd/peer_control.c

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

Loading…
Cancel
Save