Emit type / start_block / owners for one watch. */
| 532 | |
| 533 | /* Emit type / start_block / owners for one watch. */ |
| 534 | static 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. */ |
no test coverage detected