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

Function db_need_transaction

db/exec.c:132–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void db_need_transaction(struct db *db, const char *location)
133{
134 bool ok;
135
136 if (!db->in_transaction)
137 db_fatal(db, "Not in a transaction for %s", location);
138
139 if (db->transaction_started)
140 return;
141
142 db_prepare_for_changes(db);
143 ok = db->config->begin_tx_fn(db);
144 if (!ok)
145 db_fatal(db, "Failed to start DB transaction: %s", db->error);
146 db->transaction_started = true;
147}
148
149bool db_in_transaction(struct db *db)
150{

Callers 1

db_exec_prepared_v2Function · 0.85

Calls 2

db_fatalFunction · 0.85
db_prepare_for_changesFunction · 0.85

Tested by

no test coverage detected