| 4910 | } |
| 4911 | |
| 4912 | void wallet_block_remove(struct wallet *w, struct block *b) |
| 4913 | { |
| 4914 | struct db_stmt *stmt = |
| 4915 | db_prepare_v2(w->db, SQL("DELETE FROM blocks WHERE hash = ?")); |
| 4916 | db_bind_sha256d(stmt, &b->blkid.shad); |
| 4917 | db_exec_prepared_v2(take(stmt)); |
| 4918 | |
| 4919 | /* Make sure that all descendants of the block are also deleted */ |
| 4920 | stmt = db_prepare_v2(w->db, |
| 4921 | SQL("SELECT * FROM blocks WHERE height >= ?;")); |
| 4922 | db_bind_int(stmt, b->height); |
| 4923 | db_query_prepared(stmt); |
| 4924 | assert(!db_step(stmt)); |
| 4925 | tal_free(stmt); |
| 4926 | |
| 4927 | /* We might need to watch more now-unspent UTXOs */ |
| 4928 | refill_outpointfilters(w); |
| 4929 | } |
| 4930 | |
| 4931 | void wallet_blocks_rollback(struct wallet *w, u32 height) |
| 4932 | { |
no test coverage detected