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

Function db_get_runes

wallet/wallet.c:6657–6671  ·  view source on GitHub ↗

Migration code needs db, and db does not have last_used_nsec yet */

Source from the content-addressed store, hash-verified

6655
6656/* Migration code needs db, and db does not have last_used_nsec yet */
6657static const char **db_get_runes(const tal_t *ctx, struct db *db)
6658{
6659 struct db_stmt *stmt;
6660 const char **strs = tal_arr(ctx, const char *, 0);
6661
6662 stmt = db_prepare_v2(db, SQL("SELECT rune FROM runes"));
6663 db_query_prepared(stmt);
6664
6665 while (db_step(stmt)) {
6666 const char *str = db_col_strdup(strs, stmt, "rune");
6667 tal_arr_expand(&strs, str);
6668 }
6669 tal_free(stmt);
6670 return strs;
6671}
6672
6673/* Wallet has last_used_nsec by now */
6674const char **wallet_get_runes(const tal_t *ctx, struct wallet *wallet, struct timeabs **last_used)

Callers 1

migrate_runes_idfixFunction · 0.85

Calls 4

db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_strdupFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected