Turns "SELECT blockheight, txindex, outnum" into scids */
| 3980 | |
| 3981 | /* Turns "SELECT blockheight, txindex, outnum" into scids */ |
| 3982 | static const struct short_channel_id *db_scids(const tal_t *ctx, |
| 3983 | struct db_stmt *stmt STEALS) |
| 3984 | { |
| 3985 | struct short_channel_id *res = tal_arr(ctx, struct short_channel_id, 0); |
| 3986 | |
| 3987 | while (db_step(stmt)) { |
| 3988 | struct short_channel_id scid; |
| 3989 | u64 blocknum, txnum, outnum; |
| 3990 | bool ok; |
| 3991 | blocknum = db_col_int(stmt, "blockheight"); |
| 3992 | txnum = db_col_int(stmt, "txindex"); |
| 3993 | outnum = db_col_int(stmt, "outnum"); |
| 3994 | ok = mk_short_channel_id(&scid, blocknum, txnum, outnum); |
| 3995 | |
| 3996 | assert(ok); |
| 3997 | tal_arr_expand(&res, scid); |
| 3998 | } |
| 3999 | tal_free(stmt); |
| 4000 | return res; |
| 4001 | } |
| 4002 | |
| 4003 | const struct short_channel_id * |
| 4004 | wallet_utxoset_get_spent(const tal_t *ctx, struct wallet *w, |
no test coverage detected