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

Function peer_failed

common/peer_failed.c:27–51  ·  view source on GitHub ↗

We only support one channel per peer anyway */

Source from the content-addressed store, hash-verified

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

Callers 3

peer_failed_warnFunction · 0.85
peer_failed_errFunction · 0.85

Calls 5

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

Tested by

no test coverage detected