mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +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:
committed by
Christian Decker
parent
6b7b7f1007
commit
2e796ffa67
@@ -2720,8 +2720,14 @@ const char *peer_state_name(enum peer_state state)
|
|||||||
|
|
||||||
static void activate_peer(struct peer *peer)
|
static void activate_peer(struct peer *peer)
|
||||||
{
|
{
|
||||||
|
u8 *msg;
|
||||||
|
|
||||||
assert(!peer->owner);
|
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! */
|
/* FIXME: We should never have these in the database! */
|
||||||
if (!peer->funding_txid) {
|
if (!peer->funding_txid) {
|
||||||
log_broken(peer->log, "activate_peer(%s) with no 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);
|
funding_spent, NULL);
|
||||||
|
|
||||||
if (peer_wants_reconnect(peer)) {
|
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));
|
subd_send_msg(peer->ld->gossip, take(msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user