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

Function append_contents

plugins/commando.c:92–106  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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