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

Function log_journal_entry

plugins/bkpr/bookkeeper.c:827–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827static void log_journal_entry(struct account *acct,
828 const char *currency,
829 u64 timestamp,
830 struct amount_msat credit_diff,
831 struct amount_msat debit_diff)
832{
833 struct channel_event *chan_ev;
834
835 /* No diffs to register, no journal needed */
836 if (amount_msat_zero(credit_diff)
837 && amount_msat_zero(debit_diff))
838 return;
839
840 chan_ev = new_channel_event(tmpctx,
841 tal_fmt(tmpctx, "%s",
842 account_entry_tag_str(JOURNAL_ENTRY)),
843 credit_diff,
844 debit_diff,
845 AMOUNT_MSAT(0),
846 currency,
847 NULL, 0,
848 timestamp);
849 db_begin_transaction(db);
850 log_channel_event(db, acct, chan_ev);
851 db_commit_transaction(db);
852}
853
854static struct command_result *log_error(struct command *cmd,
855 const char *buf,

Callers 2

listpeers_multi_doneFunction · 0.85
listpeers_doneFunction · 0.85

Calls 5

amount_msat_zeroFunction · 0.85
log_channel_eventFunction · 0.85
new_channel_eventFunction · 0.70
account_entry_tag_strFunction · 0.70
db_commit_transactionFunction · 0.50

Tested by

no test coverage detected