Browse Source

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.
ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
71a18fdd2e
  1. 6
      daemon/peer.c

6
daemon/peer.c

@ -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…
Cancel
Save