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

Function wallet_payment_get_groupid

wallet/wallet.c:4086–4101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4084}
4085
4086u64 wallet_payment_get_groupid(struct wallet *wallet,
4087 const struct sha256 *payment_hash)
4088{
4089 struct db_stmt *stmt;
4090 u64 groupid = 0;
4091 stmt = db_prepare_v2(
4092 wallet->db, SQL("SELECT MAX(groupid) FROM payments WHERE payment_hash = ?"));
4093
4094 db_bind_sha256(stmt, payment_hash);
4095 db_query_prepared(stmt);
4096 if (db_step(stmt) && !db_col_is_null(stmt, "MAX(groupid)")) {
4097 groupid = db_col_u64(stmt, "MAX(groupid)");
4098 }
4099 tal_free(stmt);
4100 return groupid;
4101}
4102
4103void wallet_payment_delete(struct wallet *wallet,
4104 const struct sha256 *payment_hash,

Callers 3

json_sendonionFunction · 0.85
json_sendpayFunction · 0.85
json_waitsendpayFunction · 0.85

Calls 6

db_bind_sha256Function · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_is_nullFunction · 0.85
db_col_u64Function · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected