mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
connectd: Update connection list with new address
If we're already attempting to connect to a peer, we would ignore new connection requests. This is problematic if your node has bad connection details for the node -- you can't update it while inflight. This patch appends new connection suggestions to the list of connections to try. Fixes #4154
This commit is contained in:
@@ -1457,8 +1457,17 @@ static void try_connect_peer(struct daemon *daemon,
|
||||
return;
|
||||
|
||||
/* If we're trying to connect it right now, that's OK. */
|
||||
if (find_connecting(daemon, id))
|
||||
if ((connect = find_connecting(daemon, id))) {
|
||||
/* If we've been passed in new connection details
|
||||
* for this connection, update our addrhint + add
|
||||
* to addresses to check */
|
||||
if (addrhint) {
|
||||
connect->addrhint = tal_steal(connect, addrhint);
|
||||
tal_arr_expand(&connect->addrs, *addrhint);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Start an array of addresses to try. */
|
||||
addrs = tal_arr(tmpctx, struct wireaddr_internal, 0);
|
||||
|
||||
Reference in New Issue
Block a user