coin moves: persist the coin movement index counter to disk

Should make it easier to track when coin moves in the plugin are
disjoint from what c-lightning says it's broadcast already.
This commit is contained in:
lisa neigut
2020-04-03 18:58:04 -05:00
committed by Rusty Russell
parent 44f747b29a
commit ffd9467f14
10 changed files with 77 additions and 15 deletions

View File

@@ -70,6 +70,7 @@
#include <lightningd/bitcoind.h>
#include <lightningd/chaintopology.h>
#include <lightningd/channel_control.h>
#include <lightningd/coin_mvts.h>
#include <lightningd/connect_control.h>
#include <lightningd/invoice.h>
#include <lightningd/io_loop_with_timers.h>
@@ -825,6 +826,10 @@ int main(int argc, char *argv[])
* states, invoices, payments, blocks and bitcoin transactions. */
ld->wallet = wallet_new(ld, ld->timers);
/*~ We keep track of how many 'coin moves' we've ever made.
* Initialize the starting value from the database here. */
coin_mvts_init_count(ld);
/*~ We keep a filter of scriptpubkeys we're interested in. */
ld->owned_txfilter = txfilter_new(ld);