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

Function append_contents

plugins/commando.c:95–109  ·  view source on GitHub ↗

Append to commando->contents: set to NULL if we've over max. */

Source from the content-addressed store, hash-verified

93
94/* Append to commando->contents: set to NULL if we've over max. */
95static void append_contents(struct commando *commando, const u8 *msg, size_t msglen,
96 size_t maxlen)
97{
98 size_t len = tal_count(commando->contents);
99
100 if (!commando->contents)
101 return;
102
103 if (len + msglen > maxlen) {
104 commando->contents = tal_free(commando->contents);
105 return;
106 }
107
108 tal_arr_appendn(&commando->contents, msg, msglen);
109}
110
111struct reply {
112 struct commando *incoming;

Callers 2

handle_incmdFunction · 0.85
handle_replyFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected