| 4201 | } |
| 4202 | |
| 4203 | u32 wallet_transaction_height(struct wallet *w, const struct bitcoin_txid *txid) |
| 4204 | { |
| 4205 | u32 blockheight; |
| 4206 | struct db_stmt *stmt = db_prepare_v2( |
| 4207 | w->db, SQL("SELECT blockheight FROM transactions WHERE id=?")); |
| 4208 | db_bind_txid(stmt, 0, txid); |
| 4209 | db_query_prepared(stmt); |
| 4210 | |
| 4211 | if (!db_step(stmt)) { |
| 4212 | tal_free(stmt); |
| 4213 | return 0; |
| 4214 | } |
| 4215 | |
| 4216 | if (!db_col_is_null(stmt, "blockheight")) |
| 4217 | blockheight = db_col_int(stmt, "blockheight"); |
| 4218 | else |
| 4219 | blockheight = 0; |
| 4220 | tal_free(stmt); |
| 4221 | return blockheight; |
| 4222 | } |
| 4223 | |
| 4224 | struct txlocator *wallet_transaction_locate(const tal_t *ctx, struct wallet *w, |
| 4225 | const struct bitcoin_txid *txid) |
no test coverage detected