| 4933 | } |
| 4934 | |
| 4935 | void wallet_block_remove(struct wallet *w, struct block *b) |
| 4936 | { |
| 4937 | struct db_stmt *stmt = |
| 4938 | db_prepare_v2(w->db, SQL("DELETE FROM blocks WHERE hash = ?")); |
| 4939 | db_bind_sha256d(stmt, &b->blkid.shad); |
| 4940 | db_exec_prepared_v2(take(stmt)); |
| 4941 | |
| 4942 | /* Make sure that all descendants of the block are also deleted */ |
| 4943 | stmt = db_prepare_v2(w->db, |
| 4944 | SQL("SELECT * FROM blocks WHERE height >= ?;")); |
| 4945 | db_bind_int(stmt, b->height); |
| 4946 | db_query_prepared(stmt); |
| 4947 | assert(!db_step(stmt)); |
| 4948 | tal_free(stmt); |
| 4949 | |
| 4950 | /* We might need to watch more now-unspent UTXOs */ |
| 4951 | refill_outpointfilters(w); |
| 4952 | } |
| 4953 | |
| 4954 | void wallet_blocks_rollback(struct wallet *w, u32 height) |
| 4955 | { |
no test coverage detected