Browse Source

peer_control: send addrhints in activate_peer

Since we now have addresses in the database, we can resend them as hints to
gossipd on startup.

Signed-off-by: William Casarin <jb55@jb55.com>
ppa-0.6.1
William Casarin 7 years ago
committed by Christian Decker
parent
commit
2e796ffa67
  1. 8
      lightningd/peer_control.c

8
lightningd/peer_control.c

@ -2720,8 +2720,14 @@ const char *peer_state_name(enum peer_state state)
static void activate_peer(struct peer *peer)
{
u8 *msg;
assert(!peer->owner);
/* Pass gossipd any addrhints we currently have */
msg = towire_gossipctl_peer_addrhint(peer, &peer->id, &peer->addr);
subd_send_msg(peer->ld->gossip, take(msg));
/* FIXME: We should never have these in the database! */
if (!peer->funding_txid) {
log_broken(peer->log, "activate_peer(%s) with no funding txid?",
@ -2737,7 +2743,7 @@ static void activate_peer(struct peer *peer)
funding_spent, NULL);
if (peer_wants_reconnect(peer)) {
u8 *msg = towire_gossipctl_reach_peer(peer, &peer->id);
msg = towire_gossipctl_reach_peer(peer, &peer->id);
subd_send_msg(peer->ld->gossip, take(msg));
}
}

Loading…
Cancel
Save