Turns "SELECT blockheight, txindex, outnum" into scids */
| 5063 | |
| 5064 | /* Turns "SELECT blockheight, txindex, outnum" into scids */ |
| 5065 | static const struct short_channel_id *db_scids(const tal_t *ctx, |
| 5066 | struct db_stmt *stmt STEALS) |
| 5067 | { |
| 5068 | struct short_channel_id *res = tal_arr(ctx, struct short_channel_id, 0); |
| 5069 | |
| 5070 | while (db_step(stmt)) { |
| 5071 | struct short_channel_id scid; |
| 5072 | u64 blocknum, txnum, outnum; |
| 5073 | bool ok; |
| 5074 | blocknum = db_col_int(stmt, "blockheight"); |
| 5075 | txnum = db_col_int(stmt, "txindex"); |
| 5076 | outnum = db_col_int(stmt, "outnum"); |
| 5077 | ok = mk_short_channel_id(&scid, blocknum, txnum, outnum); |
| 5078 | |
| 5079 | assert(ok); |
| 5080 | tal_arr_expand(&res, scid); |
| 5081 | } |
| 5082 | tal_free(stmt); |
| 5083 | return res; |
| 5084 | } |
| 5085 | |
| 5086 | const struct short_channel_id * |
| 5087 | wallet_utxoset_get_spent(const tal_t *ctx, struct wallet *w, |
no test coverage detected