Browse Source

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 <decker.christian@gmail.com>
pull/2803/head
Christian Decker 5 years ago
committed by Rusty Russell
parent
commit
455aa48da0
  1. 15
      wallet/db.c
  2. 18
      wallet/db_common.h

15
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

18
wallet/db_common.h

@ -3,11 +3,29 @@
#include "config.h"
#include <ccan/autodata/autodata.h>
#include <ccan/short_types/short_types.h>
#include <sqlite3.h>
/* 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;

Loading…
Cancel
Save