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

Function wallet_payment_delete

wallet/wallet.c:3166–3189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3164}
3165
3166void wallet_payment_delete(struct wallet *wallet,
3167 const struct sha256 *payment_hash,
3168 const u64 *groupid,
3169 const u64 *partid)
3170{
3171 struct db_stmt *stmt;
3172 if (groupid) {
3173 assert(partid);
3174 stmt = db_prepare_v2(wallet->db,
3175 SQL("DELETE FROM payments"
3176 " WHERE payment_hash = ?"
3177 " AND groupid = ?"
3178 " AND partid = ?"));
3179 db_bind_u64(stmt, 1, *groupid);
3180 db_bind_u64(stmt, 2, *partid);
3181 } else {
3182 assert(!partid);
3183 stmt = db_prepare_v2(wallet->db,
3184 SQL("DELETE FROM payments"
3185 " WHERE payment_hash = ?"));
3186 }
3187 db_bind_sha256(stmt, 0, payment_hash);
3188 db_exec_prepared_v2(take(stmt));
3189}
3190
3191static struct wallet_payment *wallet_stmt2payment(const tal_t *ctx,
3192 struct db_stmt *stmt)

Callers 1

json_delpayFunction · 0.85

Calls 3

db_bind_u64Function · 0.85
db_bind_sha256Function · 0.85
db_exec_prepared_v2Function · 0.85

Tested by

no test coverage detected