MCPcopy Create free account
hub / github.com/ElementsProject/lightning / connect_failed

Function connect_failed

connectd/connectd.c:957–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957static void connect_failed(struct daemon *daemon,
958 const struct node_id *id,
959 bool connect_attempted,
960 const char *connect_reason,
961 struct timemono start,
962 enum jsonrpc_errcode errcode,
963 const char *errfmt, ...)
964{
965 u8 *msg;
966 va_list ap;
967 char *errmsg;
968
969 va_start(ap, errfmt);
970 errmsg = tal_vfmt(tmpctx, errfmt, ap);
971 va_end(ap);
972
973 status_peer_debug(id, "Failed connected out: %s", errmsg);
974
975 /* lightningd may have a connect command waiting to know what
976 * happened. */
977 msg = towire_connectd_connect_failed(NULL, id,
978 connect_reason,
979 time_to_nsec(timemono_since(start)),
980 errcode, errmsg,
981 connect_attempted);
982 daemon_conn_send(daemon->master, take(msg));
983
984 /* If we're supposed to schedule a reconnect, do so */
985 schedule_reconnect_if_important(daemon, id);
986
987 /* We limit thundering herd: let one out if waiting. */
988 release_one_waiting_connection(daemon,
989 tal_fmt(tmpctx, "%s connect failure",
990 fmt_node_id(tmpctx, id)));
991}
992
993/* add errors to error list */
994void add_errors_to_error_list(struct connecting *connect, const char *error)

Callers 2

try_connect_one_addrFunction · 0.70
try_connect_peerFunction · 0.70

Calls 6

time_to_nsecFunction · 0.85
timemono_sinceFunction · 0.85
daemon_conn_sendFunction · 0.85
fmt_node_idFunction · 0.85

Tested by

no test coverage detected