| 910 | } |
| 911 | |
| 912 | static void record_wallet_spend(struct lightningd *ld, |
| 913 | const struct bitcoin_outpoint *outpoint, |
| 914 | const struct bitcoin_txid *txid, |
| 915 | u32 tx_blockheight) |
| 916 | { |
| 917 | struct utxo *utxo; |
| 918 | |
| 919 | /* Find the amount this was for */ |
| 920 | utxo = wallet_utxo_get(tmpctx, ld->wallet, outpoint); |
| 921 | if (!utxo) { |
| 922 | log_broken(ld->log, "No record of utxo %s", |
| 923 | fmt_bitcoin_outpoint(tmpctx, |
| 924 | outpoint)); |
| 925 | return; |
| 926 | } |
| 927 | |
| 928 | wallet_save_chain_mvt(ld, new_coin_wallet_withdraw(tmpctx, txid, outpoint, |
| 929 | tx_blockheight, |
| 930 | utxo->amount, mk_mvt_tags(MVT_WITHDRAWAL))); |
| 931 | } |
| 932 | |
| 933 | /** |
| 934 | * topo_update_spends -- Tell the wallet about all spent outpoints |
no test coverage detected