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

Function towire_warningfmtv

common/wire_error.c:39–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39u8 *towire_warningfmtv(const tal_t *ctx,
40 const struct channel_id *channel,
41 const char *fmt,
42 va_list ap)
43{
44 /* BOLT #1:
45 *
46 * The channel is referred to by `channel_id`, unless `channel_id` is
47 * 0 (i.e. all bytes are 0), in which case it refers to all
48 * channels. */
49 static const struct channel_id all_channels;
50 char *estr;
51 u8 *msg;
52
53 estr = tal_vfmt(ctx, fmt, ap);
54 /* We need tal_len to work, so we use copy. */
55 msg = towire_warning(ctx, channel ? channel : &all_channels,
56 (u8 *)tal_dup_arr(estr, char, estr, strlen(estr), 0));
57 tal_free(estr);
58
59 return msg;
60}
61
62u8 *towire_warningfmt(const tal_t *ctx,
63 const struct channel_id *channel,

Callers 3

send_warningFunction · 0.85
warning_to_peerFunction · 0.85
towire_warningfmtFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected