From 6914adf86114956df620261eba50ffe9689d0fd5 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Wed, 1 Apr 2020 21:01:05 -0500 Subject: [PATCH] coin moves: record new wallet utxos as deposits These are incoming from onchaind, so the result of any transactions we've created or outputs we own as a result of a channel closure. These go into the 'wallet' account. --- lightningd/onchain_control.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 4102b5802..92f25451a 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -286,6 +287,7 @@ static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg U static void onchain_add_utxo(struct channel *channel, const u8 *msg) { struct utxo *u = tal(msg, struct utxo); + struct chain_coin_mvt *mvt; u32 blockheight; u->close_info = tal(u, struct unilateral_close_info); @@ -305,6 +307,10 @@ static void onchain_add_utxo(struct channel *channel, const u8 *msg) outpointfilter_add(channel->peer->ld->wallet->owned_outpoints, &u->txid, u->outnum); wallet_add_utxo(channel->peer->ld->wallet, u, p2wpkh); + + mvt = new_chain_coin_mvt_sat(msg, "wallet", &u->txid, &u->txid, u->outnum, + NULL, DEPOSIT, u->amount, true, BTC); + notify_chain_mvt(channel->peer->ld, mvt); } static void onchain_annotate_txout(struct channel *channel, const u8 *msg)