mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-23 23:06:44 +01:00
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
46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
#ifndef LIGHTNING_PLUGINS_BKPR_ACCOUNT_H
|
|
#define LIGHTNING_PLUGINS_BKPR_ACCOUNT_H
|
|
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
struct node_id;
|
|
|
|
struct account {
|
|
|
|
/* Id of this account in the database */
|
|
u64 db_id;
|
|
|
|
/* Name of account, typically channel id */
|
|
const char *name;
|
|
|
|
/* Peer we have this account with (NULL if not a channel) */
|
|
struct node_id *peer_id;
|
|
|
|
/* Is this our internal wallet account? */
|
|
bool is_wallet;
|
|
|
|
/* Is this an account we initiated open for? */
|
|
bool we_opened;
|
|
|
|
/* Was any portion of this account's funds leased? */
|
|
bool leased;
|
|
|
|
/* Block account was totally resolved at */
|
|
u64 onchain_resolved_block;
|
|
|
|
/* db_id of chain event that opened this account */
|
|
u64 *open_event_db_id;
|
|
|
|
/* db_id of chain event that closed this account */
|
|
u64 *closed_event_db_id;
|
|
};
|
|
|
|
/* Get a new account */
|
|
struct account *new_account(const tal_t *ctx,
|
|
const char *name STEALS,
|
|
struct node_id *peer_id);
|
|
|
|
/* Is this a channel account? */
|
|
bool is_channel_account(const struct account *acct);
|
|
#endif /* LIGHTNING_PLUGINS_BKPR_ACCOUNT_H */
|