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

Function connect_failed

connectd/connectd.c:901–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

899}
900
901static void connect_failed(struct daemon *daemon,
902 const struct node_id *id,
903 bool connect_attempted,
904 const char *connect_reason,
905 struct timemono start,
906 enum jsonrpc_errcode errcode,
907 const char *errfmt, ...)
908{
909 u8 *msg;
910 va_list ap;
911 char *errmsg;
912
913 va_start(ap, errfmt);
914 errmsg = tal_vfmt(tmpctx, errfmt, ap);
915 va_end(ap);
916
917 status_peer_debug(id, "Failed connected out: %s", errmsg);
918
919 /* lightningd may have a connect command waiting to know what
920 * happened. */
921 msg = towire_connectd_connect_failed(NULL, id,
922 connect_reason,
923 time_to_nsec(timemono_since(start)),
924 errcode, errmsg,
925 connect_attempted);
926 daemon_conn_send(daemon->master, take(msg));
927
928 /* If we're supposed to schedule a reconnect, do so */
929 schedule_reconnect_if_important(daemon, id);
930
931 /* We limit thundering herd: let one out if waiting. */
932 release_one_waiting_connection(daemon,
933 tal_fmt(tmpctx, "%s connect failure",
934 fmt_node_id(tmpctx, id)));
935}
936
937/* add errors to error list */
938void 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