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

Function wallet_delete_old_htlcs

wallet/wallet.c:3069–3082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3067}
3068
3069void wallet_delete_old_htlcs(struct wallet *w)
3070{
3071 struct db_stmt *stmt;
3072
3073 /* Delete htlcs for closed channels */
3074 stmt = db_prepare_v2(w->db, SQL("DELETE FROM channel_htlcs"
3075 " WHERE id IN ("
3076 " SELECT ch.id"
3077 " FROM channel_htlcs AS ch"
3078 " JOIN channels AS c ON c.id = ch.channel_id"
3079 " WHERE c.state = ?);"));
3080 db_bind_int(stmt, channel_state_in_db(CLOSED));
3081 db_exec_prepared_v2(take(stmt));
3082}
3083
3084void wallet_channel_close(struct wallet *w,
3085 const struct channel *chan)

Callers

nothing calls this directly

Calls 3

db_bind_intFunction · 0.85
channel_state_in_dbFunction · 0.85
db_exec_prepared_v2Function · 0.85

Tested by

no test coverage detected