connectd: implement connection timeout (60 seconds).

This is simple, and we now can multifundchannel to every node on testnet
(one simply hangs once we connect).

Changelog-Fixed: Protocol: We now hang up if peer doesn't respond to init message after 60 seconds.
This commit is contained in:
Rusty Russell
2020-09-11 16:18:12 +09:30
parent 1deba1c8e4
commit 7f2b332021
7 changed files with 47 additions and 10 deletions

View File

@@ -371,7 +371,8 @@ int connectd_init(struct lightningd *ld)
ld->proxyaddr, ld->use_proxy_always || ld->pure_tor_setup,
IFDEV(ld->dev_allow_localhost, false), ld->config.use_dns,
ld->tor_service_password ? ld->tor_service_password : "",
ld->config.use_v3_autotor);
ld->config.use_v3_autotor,
ld->config.connection_timeout_secs);
subd_req(ld->connectd, ld->connectd, take(msg), -1, 0,
connect_init_done, NULL);