| 3164 | } |
| 3165 | |
| 3166 | void wallet_payment_delete(struct wallet *wallet, |
| 3167 | const struct sha256 *payment_hash, |
| 3168 | const u64 *groupid, |
| 3169 | const u64 *partid) |
| 3170 | { |
| 3171 | struct db_stmt *stmt; |
| 3172 | if (groupid) { |
| 3173 | assert(partid); |
| 3174 | stmt = db_prepare_v2(wallet->db, |
| 3175 | SQL("DELETE FROM payments" |
| 3176 | " WHERE payment_hash = ?" |
| 3177 | " AND groupid = ?" |
| 3178 | " AND partid = ?")); |
| 3179 | db_bind_u64(stmt, 1, *groupid); |
| 3180 | db_bind_u64(stmt, 2, *partid); |
| 3181 | } else { |
| 3182 | assert(!partid); |
| 3183 | stmt = db_prepare_v2(wallet->db, |
| 3184 | SQL("DELETE FROM payments" |
| 3185 | " WHERE payment_hash = ?")); |
| 3186 | } |
| 3187 | db_bind_sha256(stmt, 0, payment_hash); |
| 3188 | db_exec_prepared_v2(take(stmt)); |
| 3189 | } |
| 3190 | |
| 3191 | static struct wallet_payment *wallet_stmt2payment(const tal_t *ctx, |
| 3192 | struct db_stmt *stmt) |
no test coverage detected