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

Function peer_failed_received_errmsg

common/peer_failed.c:80–100  ·  view source on GitHub ↗

We're failing because peer sent us an error/warning message */

Source from the content-addressed store, hash-verified

78
79/* We're failing because peer sent us an error/warning message */
80void peer_failed_received_errmsg(struct per_peer_state *pps,
81 const char *desc,
82 const struct channel_id *channel_id,
83 bool warning)
84{
85 u8 *msg;
86
87 /* LND sends "internal error" and we close the channel. But
88 * prior to 0.11 we would turn this into a warning, and they
89 * would recover after a reconnect. So we downgrade, but snark
90 * about it in the logs. */
91 if (!warning && strends(desc, "internal error")) {
92 status_unusual("lnd sent 'internal error':"
93 " let's give it some space");
94 warning = true;
95 }
96 msg = towire_status_peer_error(NULL, channel_id, desc, warning,
97 NULL);
98 peer_billboard(true, "Received %s", desc);
99 peer_fatal_continue(take(msg), pps);
100}
101
102void peer_failed_connection_lost(void)
103{

Callers 2

handle_peer_errorFunction · 0.85
negotiation_abortedFunction · 0.85

Calls 3

strendsFunction · 0.85
peer_fatal_continueFunction · 0.85
peer_billboardFunction · 0.70

Tested by

no test coverage detected