channel: Re-enable channel after reconnect

Simply done by sending an enabling update after reconnect.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2017-11-17 14:18:27 +01:00 committed by Rusty Russell
parent 9b42f49d2c
commit aeeb0b7011
1 changed files with 7 additions and 1 deletions

View File

@ -1513,7 +1513,7 @@ static void peer_reconnect(struct peer *peer)
bool retransmit_revoke_and_ack;
struct htlc_map_iter it;
const struct htlc *htlc;
u8 *msg;
u8 *msg, *cupdate;
/* BOLT #2:
*
@ -1676,6 +1676,12 @@ again:
if (htlc->state == SENT_REMOVE_HTLC)
send_fail_or_fulfill(peer, htlc);
}
/* Reenable channel by sending a channel_update without the
* disable flag */
cupdate = create_channel_update(peer, peer, false);
daemon_conn_send(&peer->gossip_client, cupdate);
msg_enqueue(&peer->peer_out, take(cupdate));
}
static void handle_funding_locked(struct peer *peer, const u8 *msg)