mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-05 23:24:21 +01:00
bkpr: if we're missing info about an account, add in journal entry
There's two situations where we're missing info. One is we get a 'channel_closed' event (but there's no 'channel_open') The other is a balance_snapshot arrives with information about accounts that doesn't match what's already on disk. (For some of these cases, we may be missing 'channel_open' events..) In the easy case (no channel_open missing), we just figure out what the
This commit is contained in:
30
plugins/bkpr/channel_event.c
Normal file
30
plugins/bkpr/channel_event.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <ccan/crypto/sha256/sha256.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/amount.h>
|
||||
#include <plugins/bkpr/channel_event.h>
|
||||
|
||||
struct channel_event *new_channel_event(const tal_t *ctx,
|
||||
const char *tag,
|
||||
struct amount_msat credit,
|
||||
struct amount_msat debit,
|
||||
struct amount_msat fees,
|
||||
const char *currency,
|
||||
struct sha256 *payment_id STEALS,
|
||||
u32 part_id,
|
||||
u64 timestamp)
|
||||
{
|
||||
struct channel_event *ev = tal(ctx, struct channel_event);
|
||||
|
||||
ev->tag = tal_strdup(ev, tag);
|
||||
ev->credit = credit;
|
||||
ev->debit = debit;
|
||||
ev->fees = fees;
|
||||
ev->currency = tal_strdup(ev, currency);
|
||||
ev->payment_id = tal_steal(ev, payment_id);
|
||||
ev->part_id = part_id;
|
||||
ev->timestamp = timestamp;
|
||||
|
||||
return ev;
|
||||
}
|
||||
Reference in New Issue
Block a user