| 3664 | } |
| 3665 | |
| 3666 | void wallet_htlc_sigs_save(struct wallet *w, u64 channel_id, |
| 3667 | const struct bitcoin_signature *htlc_sigs) |
| 3668 | { |
| 3669 | /* Clear any existing HTLC sigs for this channel */ |
| 3670 | struct db_stmt *stmt = db_prepare_v2( |
| 3671 | w->db, SQL("DELETE FROM htlc_sigs WHERE channelid = ?")); |
| 3672 | db_bind_u64(stmt, 0, channel_id); |
| 3673 | db_exec_prepared_v2(take(stmt)); |
| 3674 | |
| 3675 | /* Now insert the new ones */ |
| 3676 | for (size_t i=0; i<tal_count(htlc_sigs); i++) { |
| 3677 | stmt = db_prepare_v2(w->db, |
| 3678 | SQL("INSERT INTO htlc_sigs (channelid, " |
| 3679 | "signature) VALUES (?, ?)")); |
| 3680 | db_bind_u64(stmt, 0, channel_id); |
| 3681 | db_bind_signature(stmt, 1, &htlc_sigs[i].s); |
| 3682 | db_exec_prepared_v2(take(stmt)); |
| 3683 | } |
| 3684 | } |
| 3685 | |
| 3686 | bool wallet_sanity_check(struct wallet *w) |
| 3687 | { |
no test coverage detected