| 825 | } |
| 826 | |
| 827 | static 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 | |
| 854 | static struct command_result *log_error(struct command *cmd, |
| 855 | const char *buf, |
no test coverage detected