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

Function db_sqlite3_begin_tx

db/db_sqlite3.c:317–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317static bool db_sqlite3_begin_tx(struct db *db)
318{
319 int err;
320 char *errmsg;
321
322 struct db_sqlite3 *wrapper = (struct db_sqlite3 *) db->conn;
323
324 err = sqlite3_exec(conn2sql(db->conn),
325 "BEGIN TRANSACTION;", NULL, NULL, &errmsg);
326 if (err != SQLITE_OK) {
327 db->error = tal_fmt(db, "Failed to begin a transaction: %s", errmsg);
328 return false;
329 }
330 replicate_statement(db, wrapper, "BEGIN TRANSACTION;");
331 return true;
332}
333
334static bool db_sqlite3_commit_tx(struct db *db)
335{

Callers

nothing calls this directly

Calls 2

conn2sqlFunction · 0.85
replicate_statementFunction · 0.85

Tested by

no test coverage detected