| 4084 | } |
| 4085 | |
| 4086 | u64 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 | |
| 4103 | void wallet_payment_delete(struct wallet *wallet, |
| 4104 | const struct sha256 *payment_hash, |
no test coverage detected