We take over the --bookkeeper-dir and --bookkeeper-db options, and then if we can find the bookkeeper db we extract the records to initialize our chain_moves and channel_moves tables. Of course, bookkeeper now needs to not register those options. When bookkeeper gets invoked the first time, it will reconstruct everything from listchannelmoves and listcoinmoves. It cannot preserve manually-added descriptions, so we put those in the datastore for it ready to go. Note that the order of onchain_fee changes slightly from the original. But this is fine. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
29 lines
792 B
C
29 lines
792 B
C
#ifndef LIGHTNING_PLUGINS_BKPR_BOOKKEEPER_H
|
|
#define LIGHTNING_PLUGINS_BKPR_BOOKKEEPER_H
|
|
|
|
#include "config.h"
|
|
#include <common/json_parse.h>
|
|
|
|
struct command;
|
|
|
|
struct bkpr {
|
|
/* The datastore-backed lookup tables for our annotations */
|
|
struct accounts *accounts;
|
|
struct onchain_fees *onchain_fees;
|
|
struct descriptions *descriptions;
|
|
struct rebalances *rebalances;
|
|
struct blockheights *blockheights;
|
|
|
|
/* Where we're up to in listchainmoves, listchannelmoves */
|
|
u64 chainmoves_index, channelmoves_index;
|
|
};
|
|
|
|
/* Helper to ignore returns from datastore */
|
|
struct command_result *ignore_datastore_reply(struct command *cmd,
|
|
const char *method,
|
|
const char *buf,
|
|
const jsmntok_t *result,
|
|
void *arg);
|
|
|
|
#endif /* LIGHTNING_PLUGINS_BKPR_BOOKKEEPER_H */
|