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

Function db_write

tests/plugins/dblog.py:36–50  ·  view source on GitHub ↗
(plugin, writes, **kwargs)

Source from the content-addressed store, hash-verified

34
35@plugin.hook('db_write')
36def db_write(plugin, writes, **kwargs):
37 if not plugin.initted:
38 plugin.log("deferring {} commands".format(len(writes)))
39 plugin.sqlite_pre_init_cmds += writes
40 else:
41 print(writes)
42 plugin.conn.execute("BEGIN TRANSACTION;")
43
44 for c in writes:
45 plugin.conn.execute(c)
46 plugin.log("{}".format(c))
47
48 plugin.conn.execute("COMMIT;")
49
50 return {"result": "continue"}
51
52
53plugin.add_option('dblog-file', None, 'The db file to create.')

Callers

nothing calls this directly

Calls 2

logMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected