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

Function db_postgres_begin_tx

db/db_postgres.c:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46static bool db_postgres_begin_tx(struct db *db)
47{
48 assert(db->conn);
49 PGresult *res;
50 res = PQexec(db->conn, "BEGIN;");
51 if (PQresultStatus(res) != PGRES_COMMAND_OK) {
52 db->error = tal_fmt(db, "BEGIN command failed: %s",
53 PQerrorMessage(db->conn));
54 PQclear(res);
55 return false;
56 }
57 PQclear(res);
58 return true;
59}
60
61static bool db_postgres_commit_tx(struct db *db)
62{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected