MCPcopy Create free account
hub / github.com/ElementsProject/lightning / wallet_channel_config_save

Function wallet_channel_config_save

wallet/wallet.c:1799–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1797}
1798
1799static 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
1825u64 wallet_get_channel_dbid(struct wallet *wallet)
1826{

Callers 2

wallet_channel_saveFunction · 0.85
test_channel_config_crudFunction · 0.85

Calls 5

db_bind_amount_satFunction · 0.85
db_bind_amount_msatFunction · 0.85
db_bind_intFunction · 0.85
db_bind_u64Function · 0.85
db_exec_prepared_v2Function · 0.85

Tested by 1

test_channel_config_crudFunction · 0.68