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

Function db_get_intvar

db/exec.c:78–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78s64 db_get_intvar(struct db *db, char *varname, s64 defval)
79{
80 s64 res = defval;
81 struct db_stmt *stmt = db_prepare_v2(
82 db, SQL("SELECT intval FROM vars WHERE name= ? LIMIT 1"));
83 db_bind_text(stmt, 0, varname);
84 if (db_query_prepared(stmt) && db_step(stmt))
85 res = db_col_int(stmt, "intval");
86
87 tal_free(stmt);
88 return res;
89}
90
91/* Leak tracking. */
92

Callers 7

json_listaddrsFunction · 0.50
wallet_can_spendFunction · 0.50
wallet_get_newindexFunction · 0.50
wallet_forward_deleteFunction · 0.50
get_next_pay_indexFunction · 0.50
test_varsFunction · 0.50

Calls 5

db_bind_textFunction · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_intFunction · 0.85
tal_freeFunction · 0.85

Tested by 1

test_varsFunction · 0.40