mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-23 06:55:13 +01:00
recovery: save last_known_addr for peer if we know it.
This is more useful than the last address, which may be it connecting to us. And use it when we restore it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
22a481fbaa
commit
ff290b19c9
2 changed files with 4 additions and 1 deletions
|
@ -487,6 +487,9 @@ struct channel *new_channel(struct peer *peer, u64 dbid,
|
|||
channel->scb = tal(channel, struct scb_chan);
|
||||
channel->scb->id = dbid;
|
||||
channel->scb->unused = 0;
|
||||
/* More useful to have last_known_addr, if avail */
|
||||
if (peer->last_known_addr)
|
||||
channel->scb->addr = *peer->last_known_addr;
|
||||
channel->scb->addr = peer->addr.u.wireaddr.wireaddr;
|
||||
channel->scb->node_id = peer->id;
|
||||
channel->scb->funding = *funding;
|
||||
|
|
|
@ -1493,7 +1493,7 @@ static struct channel *stub_chan(struct command *cmd,
|
|||
0,
|
||||
&nodeid,
|
||||
&wint,
|
||||
NULL,
|
||||
&addr,
|
||||
NULL,
|
||||
false);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue