From b7d85f1d0b6412b8894b3c365c9b0ffa8b375ca0 Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 19 Jul 2022 17:04:35 +0930 Subject: [PATCH] bkpr: wire up our chain fee accting to chain event reception When we get a chain event, check to see if this updates any onchain fee records that we have. --- plugins/bkpr/bookkeeper.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/bkpr/bookkeeper.c b/plugins/bkpr/bookkeeper.c index c51831c93..91e9ceb88 100644 --- a/plugins/bkpr/bookkeeper.c +++ b/plugins/bkpr/bookkeeper.c @@ -184,9 +184,17 @@ static const char *parse_and_log_chain_move(struct command *cmd, maybe_update_account(db, acct, e, tags); /* Can we calculate any onchain fees now? */ + err = maybe_update_onchain_fees(cmd, db, + e->spending_txid ? + e->spending_txid : + &e->outpoint.txid); + + db_commit_transaction(db); + + if (err) + return err; /* FIXME: maybe mark channel as 'onchain_resolved' */ - db_commit_transaction(db); return NULL; }