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

Function json_out_watch_common

plugins/bwatch/bwatch_interface.c:534–545  ·  view source on GitHub ↗

Emit type / start_block / owners for one watch. */

Source from the content-addressed store, hash-verified

532
533/* Emit type / start_block / owners for one watch. */
534static void json_out_watch_common(struct json_out *jout,
535 enum watch_type type,
536 u32 start_block,
537 wirestring **owners)
538{
539 json_out_addstr(jout, "type", bwatch_get_watch_type_name(type));
540 json_out_add(jout, "start_block", false, "%u", start_block);
541 json_out_start(jout, "owners", '[');
542 for (size_t i = 0; i < tal_count(owners); i++)
543 json_out_addstr(jout, NULL, owners[i]);
544 json_out_end(jout, ']');
545}
546
547/* Dump every active watch as a flat array; per-type fields go first
548 * so the consumer can dispatch on shape. */

Callers 1

json_bwatch_listFunction · 0.85

Calls 5

json_out_addstrFunction · 0.85
json_out_addFunction · 0.85
json_out_startFunction · 0.85
json_out_endFunction · 0.85

Tested by

no test coverage detected