mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossip: Trigger announce on channel establishment
Since we ultimately want to have a very long re-announcement timeout we better trigger an announcement upon channel state change to normal.
This commit is contained in:
parent
e54c0adced
commit
71a18fdd2e
@ -746,6 +746,7 @@ static bool open_wait_pkt_in(struct peer *peer, const Pkt *pkt)
|
||||
if (peer->state == STATE_OPEN_WAIT_THEIRCOMPLETE) {
|
||||
peer_open_complete(peer, NULL);
|
||||
set_peer_state(peer, STATE_NORMAL, __func__, true);
|
||||
announce_channel(peer->dstate, peer);
|
||||
} else {
|
||||
set_peer_state(peer, STATE_OPEN_WAIT_ANCHORDEPTH,
|
||||
__func__, true);
|
||||
@ -2527,6 +2528,10 @@ static struct io_plan *init_pkt_in(struct io_conn *conn, struct peer *peer)
|
||||
peer->inpkt = tal_free(peer->inpkt);
|
||||
|
||||
peer_has_connected(peer);
|
||||
|
||||
if (state_is_normal(peer->state))
|
||||
announce_channel(peer->dstate, peer);
|
||||
|
||||
return io_duplex(conn,
|
||||
peer_read_packet(conn, peer, pkt_in),
|
||||
pkt_out(conn, peer));
|
||||
@ -3311,6 +3316,7 @@ static void peer_depth_ok(struct peer *peer)
|
||||
case STATE_OPEN_WAIT_ANCHORDEPTH:
|
||||
peer_open_complete(peer, NULL);
|
||||
set_peer_state(peer, STATE_NORMAL, __func__, true);
|
||||
announce_channel(peer->dstate, peer);
|
||||
break;
|
||||
default:
|
||||
log_broken(peer->log, "%s: state %s",
|
||||
|
Loading…
Reference in New Issue
Block a user