| 5223 | } |
| 5224 | |
| 5225 | struct db_stmt *wallet_datastore_next(const tal_t *ctx, |
| 5226 | struct wallet *w, |
| 5227 | struct db_stmt *stmt, |
| 5228 | const char ***key, |
| 5229 | const u8 **data, |
| 5230 | u64 *generation) |
| 5231 | { |
| 5232 | if (!db_step(stmt)) |
| 5233 | return tal_free(stmt); |
| 5234 | |
| 5235 | *key = db_col_datastore_key(ctx, stmt, "key"); |
| 5236 | if (data) |
| 5237 | *data = db_col_arr(ctx, stmt, "data", u8); |
| 5238 | else |
| 5239 | db_col_ignore(stmt, "data"); |
| 5240 | |
| 5241 | if (generation) |
| 5242 | *generation = db_col_u64(stmt, "generation"); |
| 5243 | else |
| 5244 | db_col_ignore(stmt, "generation"); |
| 5245 | |
| 5246 | return stmt; |
| 5247 | } |
| 5248 | |
| 5249 | /* We use a different query form if we only care about a single channel. */ |
| 5250 | struct wallet_htlc_iter { |
no test coverage detected