mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
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>
This commit is contained in:
parent
6b7b7f1007
commit
2e796ffa67
1 changed files with 7 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue