bkpr: expose struct bkpr to outside bookkeeper.c.

We're going to add more members here, so we will start handing around
the whole thing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-08-19 10:30:47 +09:30
parent c00d12fa0d
commit 41856dc6c0
3 changed files with 16 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ BOOKKEEPER_SRC := $(BOOKKEEPER_PLUGIN_SRC) $(BOOKKEEPER_DB_QUERIES)
BOOKKEEPER_HEADER := \
plugins/bkpr/account.h \
plugins/bkpr/account_entry.h \
plugins/bkpr/bookkeeper.h \
plugins/bkpr/chain_event.h \
plugins/bkpr/channel_event.h \
plugins/bkpr/channelsapy.h \

View File

@@ -16,6 +16,7 @@
#include <errno.h>
#include <plugins/bkpr/account.h>
#include <plugins/bkpr/account_entry.h>
#include <plugins/bkpr/bookkeeper.h>
#include <plugins/bkpr/chain_event.h>
#include <plugins/bkpr/channel_event.h>
#include <plugins/bkpr/channelsapy.h>
@@ -30,14 +31,6 @@
#define CHAIN_MOVE "chain_mvt"
#define CHANNEL_MOVE "channel_mvt"
struct bkpr {
/* The database that we store all the accounting data in */
struct db *db;
char *db_dsn;
char *datadir;
};
static struct bkpr *bkpr_of(struct plugin *plugin)
{
return plugin_get_data(plugin, struct bkpr);

14
plugins/bkpr/bookkeeper.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef LIGHTNING_PLUGINS_BKPR_BOOKKEEPER_H
#define LIGHTNING_PLUGINS_BKPR_BOOKKEEPER_H
#include "config.h"
struct bkpr {
/* The database that we store all the accounting data in */
struct db *db;
char *db_dsn;
char *datadir;
};
#endif /* LIGHTNING_PLUGINS_BKPR_BOOKKEEPER_H */