| 4250 | } |
| 4251 | |
| 4252 | struct bitcoin_txid *wallet_transactions_by_height(const tal_t *ctx, |
| 4253 | struct wallet *w, |
| 4254 | const u32 blockheight) |
| 4255 | { |
| 4256 | struct db_stmt *stmt; |
| 4257 | struct bitcoin_txid *txids = tal_arr(ctx, struct bitcoin_txid, 0); |
| 4258 | int count = 0; |
| 4259 | stmt = db_prepare_v2( |
| 4260 | w->db, SQL("SELECT id FROM transactions WHERE blockheight=?")); |
| 4261 | db_bind_int(stmt, 0, blockheight); |
| 4262 | db_query_prepared(stmt); |
| 4263 | |
| 4264 | while (db_step(stmt)) { |
| 4265 | count++; |
| 4266 | tal_resize(&txids, count); |
| 4267 | db_col_txid(stmt, "id", &txids[count-1]); |
| 4268 | } |
| 4269 | tal_free(stmt); |
| 4270 | |
| 4271 | return txids; |
| 4272 | } |
| 4273 | |
| 4274 | void wallet_channeltxs_add(struct wallet *w, struct channel *chan, |
| 4275 | const int type, const struct bitcoin_txid *txid, |
no test coverage detected