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

Function db_setup

plugins/bkpr/test/run-recorder.c:242–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242static sqlite3 *db_setup(struct plugin *p, const char *db_dsn)
243{
244 sqlite3_stmt *stmt;
245 sqlite3 *sql;
246 int err;
247
248 err = sqlite3_open_v2(db_dsn, &sql, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, NULL);
249 assert(err == SQLITE_OK);
250
251 err = sqlite3_extended_result_codes(sql, 1);
252 assert(err == SQLITE_OK);
253
254 sqlite3_busy_timeout(sql, 60000);
255 sqlite3_prepare_v2(sql,
256 "PRAGMA foreign_keys = ON;", -1, &stmt, NULL);
257 err = sqlite3_step(stmt);
258 assert(err == SQLITE_DONE);
259 sqlite3_finalize(stmt);
260
261 db_migrate(p, sql);
262 return sql;
263}
264
265static int sqlite3_bind_outpoint(sqlite3_stmt *stmt, int pos, const struct bitcoin_outpoint *o)
266{

Callers 1

bkpr_setupFunction · 0.70

Calls 1

db_migrateFunction · 0.70

Tested by

no test coverage detected