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

Function peer_failed

common/peer_failed.c:26–48  ·  view source on GitHub ↗

We only support one channel per peer anyway */

Source from the content-addressed store, hash-verified

24
25/* We only support one channel per peer anyway */
26static void NORETURN
27peer_failed(struct per_peer_state *pps,
28 bool warn,
29 const struct channel_id *channel_id,
30 const char *desc)
31{
32 u8 *msg;
33
34 if (warn) {
35 msg = towire_warningfmt(desc, channel_id, "%s", desc);
36 } else {
37 msg = towire_errorfmt(desc, channel_id, "%s", desc);
38 }
39 peer_write(pps, msg);
40
41 /* Tell master the error so it can re-xmit. */
42 msg = towire_status_peer_error(NULL, channel_id,
43 desc,
44 warn,
45 msg);
46 peer_billboard(true, desc);
47 peer_fatal_continue(take(msg), pps);
48}
49
50void peer_failed_warn(struct per_peer_state *pps,
51 const struct channel_id *channel_id,

Callers 2

peer_failed_warnFunction · 0.85
peer_failed_errFunction · 0.85

Calls 5

peer_writeFunction · 0.85
peer_fatal_continueFunction · 0.85
towire_warningfmtFunction · 0.70
towire_errorfmtFunction · 0.70
peer_billboardFunction · 0.70

Tested by

no test coverage detected