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

Function dump_segments

common/splice_script.c:226–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224
225#if SCRIPT_DUMP_SEGMENTS
226static struct splice_script_error *dump_segments(const tal_t *ctx,
227 struct token **tokens)
228{
229 struct splice_script_error *error = tal(ctx,
230 struct splice_script_error);
231
232 error->type = DEBUG_DUMP;
233 error->script_index = 0;
234 error->message = tal_strdup(error, "");
235
236 for (size_t i = 0; i < tal_count(tokens); i++) {
237 if (tokens[i]->type == TOK_SEGMENT) {
238 dump_token_shallow(&error->message, tokens[i]->left,
239 "");
240 dump_token_shallow(&error->message, tokens[i]->middle,
241 " -> ");
242 if (tokens[i]->right)
243 dump_token_shallow(&error->message,
244 tokens[i]->right, " -> ");
245 }
246 else {
247 tal_append_fmt(&error->message, "Invalid token!! ");
248 dump_token_shallow(&error->message, tokens[i], "");
249 }
250 tal_append_fmt(&error->message, "\n");
251 }
252
253 return error;
254}
255#endif /* SCRIPT_DUMP_SEGMENTS */
256
257static struct splice_script_error *new_error_offset(const tal_t *ctx,

Callers 1

parse_splice_scriptFunction · 0.85

Calls 2

dump_token_shallowFunction · 0.85
tal_append_fmtFunction · 0.85

Tested by

no test coverage detected