From 455aa48da0306a5f57accf8d28e480ac5c2cbfa1 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 25 Jul 2019 18:15:34 +0200 Subject: [PATCH] wallet: Move the struct db definition to db_common.h All drivers will have to reach into it, so put it in a place that is reachable from the drivers, along with all other definitions. Signed-off-by: Christian Decker --- wallet/db.c | 15 --------------- wallet/db_common.h | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/wallet/db.c b/wallet/db.c index 08671b78c..180a8d174 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -19,21 +19,6 @@ struct migration { void (*func)(struct lightningd *ld, struct db *db); }; -struct db { - char *filename; - const char *in_transaction; - sqlite3 *sql; - - /* DB-specific context */ - void *conn; - - /* The configuration, including translated queries for the current - * instance. */ - const struct db_config *config; - - const char **changes; -}; - void migrate_pr2342_feerate_per_channel(struct lightningd *ld, struct db *db); /* Do not reorder or remove elements from this array, it is used to diff --git a/wallet/db_common.h b/wallet/db_common.h index 8156d6a1f..15d428fcb 100644 --- a/wallet/db_common.h +++ b/wallet/db_common.h @@ -3,11 +3,29 @@ #include "config.h" #include #include +#include + /* For testing, we want to catch fatal messages. */ #ifndef db_fatal #define db_fatal fatal #endif +struct db { + char *filename; + const char *in_transaction; + sqlite3 *sql; + + /* DB-specific context */ + void *conn; + + /* The configuration, including translated queries for the current + * instance. */ + const struct db_config *config; + + const char **changes; + + char *error; +}; struct db_query { const char *name;