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

Function towire_abortfmtv

common/wire_error.c:76–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76u8 *towire_abortfmtv(const tal_t *ctx,
77 const struct channel_id *channel,
78 const char *fmt,
79 va_list ap)
80{
81 /* BOLT #1:
82 *
83 * The channel is referred to by `channel_id`, unless `channel_id` is
84 * 0 (i.e. all bytes are 0), in which case it refers to all
85 * channels. */
86 static const struct channel_id all_channels;
87 char *estr;
88 u8 *msg;
89
90 estr = tal_vfmt(ctx, fmt, ap);
91 /* We need tal_len to work, so we use copy. */
92 msg = towire_tx_abort(ctx, channel ? channel : &all_channels,
93 (u8 *)tal_dup_arr(estr, char, estr, strlen(estr), 0));
94 tal_free(estr);
95
96 return msg;
97}
98
99u8 *towire_abortfmt(const tal_t *ctx,
100 const struct channel_id *channel,

Callers 1

towire_abortfmtFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected