Hardly a common operation! Delete and rewrite entire table */
| 6723 | |
| 6724 | /* Hardly a common operation! Delete and rewrite entire table */ |
| 6725 | void wallet_set_blacklist(struct wallet *wallet, const struct rune_blacklist *blist) |
| 6726 | { |
| 6727 | struct db_stmt *stmt; |
| 6728 | stmt = db_prepare_v2(wallet->db, SQL("DELETE FROM runes_blacklist")); |
| 6729 | db_exec_prepared_v2(take(stmt)); |
| 6730 | |
| 6731 | for (size_t i = 0; i < tal_count(blist); i++) { |
| 6732 | stmt = db_prepare_v2(wallet->db, |
| 6733 | SQL("INSERT INTO runes_blacklist VALUES (?,?)")); |
| 6734 | db_bind_u64(stmt, blist[i].start); |
| 6735 | db_bind_u64(stmt, blist[i].end); |
| 6736 | db_exec_prepared_v2(take(stmt)); |
| 6737 | } |
| 6738 | } |
| 6739 | |
| 6740 | void migrate_datastore_commando_runes(struct lightningd *ld, struct db *db) |
| 6741 | { |
no test coverage detected