From 41856dc6c0f86d3f702fa3addc835b2bbf11d5d8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 19 Aug 2025 10:30:47 +0930 Subject: [PATCH] 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 --- plugins/bkpr/Makefile | 1 + plugins/bkpr/bookkeeper.c | 9 +-------- plugins/bkpr/bookkeeper.h | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 plugins/bkpr/bookkeeper.h diff --git a/plugins/bkpr/Makefile b/plugins/bkpr/Makefile index 18599631c..3b8b9b736 100644 --- a/plugins/bkpr/Makefile +++ b/plugins/bkpr/Makefile @@ -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 \ diff --git a/plugins/bkpr/bookkeeper.c b/plugins/bkpr/bookkeeper.c index 9a058950f..df55c0c1d 100644 --- a/plugins/bkpr/bookkeeper.c +++ b/plugins/bkpr/bookkeeper.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -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); diff --git a/plugins/bkpr/bookkeeper.h b/plugins/bkpr/bookkeeper.h new file mode 100644 index 000000000..97c09e1cf --- /dev/null +++ b/plugins/bkpr/bookkeeper.h @@ -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 */