| 1797 | } |
| 1798 | |
| 1799 | static void wallet_channel_config_save(struct wallet *w, |
| 1800 | const struct channel_config *cc) |
| 1801 | { |
| 1802 | struct db_stmt *stmt; |
| 1803 | |
| 1804 | assert(cc->id != 0); |
| 1805 | stmt = db_prepare_v2(w->db, SQL("UPDATE channel_configs SET" |
| 1806 | " dust_limit_satoshis=?," |
| 1807 | " max_htlc_value_in_flight_msat=?," |
| 1808 | " channel_reserve_satoshis=?," |
| 1809 | " htlc_minimum_msat=?," |
| 1810 | " to_self_delay=?," |
| 1811 | " max_accepted_htlcs=?," |
| 1812 | " max_dust_htlc_exposure_msat=?" |
| 1813 | " WHERE id=?;")); |
| 1814 | db_bind_amount_sat(stmt, 0, &cc->dust_limit); |
| 1815 | db_bind_amount_msat(stmt, 1, &cc->max_htlc_value_in_flight); |
| 1816 | db_bind_amount_sat(stmt, 2, &cc->channel_reserve); |
| 1817 | db_bind_amount_msat(stmt, 3, &cc->htlc_minimum); |
| 1818 | db_bind_int(stmt, 4, cc->to_self_delay); |
| 1819 | db_bind_int(stmt, 5, cc->max_accepted_htlcs); |
| 1820 | db_bind_amount_msat(stmt, 6, &cc->max_dust_htlc_exposure_msat); |
| 1821 | db_bind_u64(stmt, 7, cc->id); |
| 1822 | db_exec_prepared_v2(take(stmt)); |
| 1823 | } |
| 1824 | |
| 1825 | u64 wallet_get_channel_dbid(struct wallet *wallet) |
| 1826 | { |