| 67 | } |
| 68 | |
| 69 | static struct chain_event **find_chain_events(const tal_t *ctx, |
| 70 | struct db_stmt *stmt TAKES) |
| 71 | { |
| 72 | struct chain_event **results; |
| 73 | |
| 74 | db_query_prepared(stmt); |
| 75 | if (stmt->error) |
| 76 | db_fatal("find_chain_events err: %s", stmt->error); |
| 77 | results = tal_arr(ctx, struct chain_event *, 0); |
| 78 | while (db_step(stmt)) { |
| 79 | struct chain_event *e = stmt2chain_event(results, stmt); |
| 80 | tal_arr_expand(&results, e); |
| 81 | } |
| 82 | |
| 83 | if (taken(stmt)) |
| 84 | tal_free(stmt); |
| 85 | |
| 86 | return results; |
| 87 | } |
| 88 | |
| 89 | static struct channel_event *stmt2channel_event(const tal_t *ctx, struct db_stmt *stmt) |
| 90 | { |
no test coverage detected