| 7108 | } |
| 7109 | |
| 7110 | void wallet_save_chain_mvt(struct lightningd *ld, |
| 7111 | const struct chain_coin_mvt *chain_mvt) |
| 7112 | { |
| 7113 | u64 id; |
| 7114 | |
| 7115 | /* On restart, we do chain replay. For this (and other |
| 7116 | * reorgs) we need to de-duplicate here. The other db tables |
| 7117 | * do this by deleting old entries on reorg, but we never |
| 7118 | * delete. */ |
| 7119 | if (is_duplicate(ld->wallet->db, chain_mvt)) |
| 7120 | goto out; |
| 7121 | |
| 7122 | id = insert_chain_mvt(ld, ld->wallet->db, chain_mvt); |
| 7123 | notify_chain_mvt(ld, chain_mvt, id); |
| 7124 | out: |
| 7125 | tal_free_if_taken(chain_mvt); |
| 7126 | } |
| 7127 | |
| 7128 | static void db_cols_account(struct db_stmt *stmt, |
| 7129 | struct lightningd *ld, |