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

Function connect_failed

connectd/connectd.c:904–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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