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

Function db_get_intvar

db/exec.c:79–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 11

json_listaddrsFunction · 0.50
load_indexesFunction · 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_stepFunction · 0.85
db_col_intFunction · 0.85
tal_freeFunction · 0.85

Tested by 1

test_varsFunction · 0.40