mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
connectd: fix fd leak for --offline.
``` **BROKEN** connectd: dev_report_fds: 5 open but unowned? ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
35a47c57e3
commit
25110ff2cc
@ -1543,6 +1543,9 @@ static void connect_activate(struct daemon *daemon, const u8 *msg)
|
||||
->is_websocket),
|
||||
daemon));
|
||||
}
|
||||
} else {
|
||||
for (size_t i = 0; i < tal_count(daemon->listen_fds); i++)
|
||||
close(daemon->listen_fds[i]->fd);
|
||||
}
|
||||
|
||||
/* Free, with NULL assignment just as an extra sanity check. */
|
||||
|
@ -4409,3 +4409,9 @@ def test_reconnect_no_additional_transient_failure(node_factory, bitcoind):
|
||||
|
||||
# We should not see a "Peer transient failure" after restart of l1
|
||||
assert not l1.daemon.is_in_log(f"{l2id}-chan#1: Peer transient failure in CHANNELD_NORMAL: Disconnected", start=offset1)
|
||||
|
||||
|
||||
def test_offline_fd_check(node_factory):
|
||||
# if get_node starts it, it'll expect an address, so do it manually.
|
||||
l1 = node_factory.get_node(options={"offline": None}, start=False)
|
||||
l1.daemon.start()
|
||||
|
Loading…
Reference in New Issue
Block a user