Turns "SELECT blockheight, txindex, outnum" into scids */
| 5123 | |
| 5124 | /* Turns "SELECT blockheight, txindex, outnum" into scids */ |
| 5125 | static const struct short_channel_id *db_scids(const tal_t *ctx, |
| 5126 | struct db_stmt *stmt STEALS) |
| 5127 | { |
| 5128 | struct short_channel_id *res = tal_arr(ctx, struct short_channel_id, 0); |
| 5129 | |
| 5130 | while (db_step(stmt)) { |
| 5131 | struct short_channel_id scid; |
| 5132 | u64 blocknum, txnum, outnum; |
| 5133 | bool ok; |
| 5134 | blocknum = db_col_int(stmt, "blockheight"); |
| 5135 | txnum = db_col_int(stmt, "txindex"); |
| 5136 | outnum = db_col_int(stmt, "outnum"); |
| 5137 | ok = mk_short_channel_id(&scid, blocknum, txnum, outnum); |
| 5138 | |
| 5139 | assert(ok); |
| 5140 | tal_arr_expand(&res, scid); |
| 5141 | } |
| 5142 | tal_free(stmt); |
| 5143 | return res; |
| 5144 | } |
| 5145 | |
| 5146 | const struct short_channel_id * |
| 5147 | wallet_utxoset_get_spent(const tal_t *ctx, struct wallet *w, |
no test coverage detected