mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-05 23:24:21 +01:00
One really rough thing about how we did onchain fees is that the records update every time a new event comes in. The better way to do this is to create new entries for every adjustment, so that reconciliation between printouts isn't a misery. We add a timestamp and `update_count` to these records, so you can roughly order them now (and have a good idea of the last time an event that updated an onchain_fee occurred).
33 lines
703 B
C
33 lines
703 B
C
#ifndef LIGHTNING_PLUGINS_BKPR_ONCHAIN_FEE_H
|
|
#define LIGHTNING_PLUGINS_BKPR_ONCHAIN_FEE_H
|
|
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
struct amount_msat;
|
|
struct bitcoin_txid;
|
|
|
|
struct onchain_fee {
|
|
|
|
/* db_id of account this event belongs to */
|
|
u64 acct_db_id;
|
|
|
|
/* Transaction that we're recording fees for */
|
|
struct bitcoin_txid txid;
|
|
|
|
/* Incremental change in onchain fees */
|
|
struct amount_msat credit;
|
|
struct amount_msat debit;
|
|
|
|
/* What token are fees? */
|
|
char *currency;
|
|
|
|
/* Timestamp of the event that created this fee update */
|
|
u64 timestamp;
|
|
|
|
/* Count of records we've recorded for this tx */
|
|
u32 update_count;
|
|
};
|
|
|
|
#endif /* LIGHTNING_PLUGINS_BKPR_ONCHAIN_FEE_H */
|