| 5304 | } |
| 5305 | |
| 5306 | u32 wallet_transaction_height(struct wallet *w, const struct bitcoin_txid *txid) |
| 5307 | { |
| 5308 | u32 blockheight; |
| 5309 | struct db_stmt *stmt = db_prepare_v2( |
| 5310 | w->db, SQL("SELECT blockheight FROM transactions WHERE id=?")); |
| 5311 | db_bind_txid(stmt, txid); |
| 5312 | db_query_prepared(stmt); |
| 5313 | |
| 5314 | if (!db_step(stmt)) { |
| 5315 | tal_free(stmt); |
| 5316 | return 0; |
| 5317 | } |
| 5318 | |
| 5319 | if (!db_col_is_null(stmt, "blockheight")) |
| 5320 | blockheight = db_col_int(stmt, "blockheight"); |
| 5321 | else |
| 5322 | blockheight = 0; |
| 5323 | tal_free(stmt); |
| 5324 | return blockheight; |
| 5325 | } |
| 5326 | |
| 5327 | struct bitcoin_txid *wallet_transactions_by_height(const tal_t *ctx, |
| 5328 | struct wallet *w, |
nothing calls this directly
no test coverage detected