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

Function wallet_delete_old_htlcs

wallet/wallet.c:3092–3105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3090}
3091
3092void wallet_delete_old_htlcs(struct wallet *w)
3093{
3094 struct db_stmt *stmt;
3095
3096 /* Delete htlcs for closed channels */
3097 stmt = db_prepare_v2(w->db, SQL("DELETE FROM channel_htlcs"
3098 " WHERE id IN ("
3099 " SELECT ch.id"
3100 " FROM channel_htlcs AS ch"
3101 " JOIN channels AS c ON c.id = ch.channel_id"
3102 " WHERE c.state = ?);"));
3103 db_bind_int(stmt, channel_state_in_db(CLOSED));
3104 db_exec_prepared_v2(take(stmt));
3105}
3106
3107void wallet_channel_close(struct wallet *w,
3108 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