| 636 | } |
| 637 | |
| 638 | static void record_wallet_spend(struct lightningd *ld, |
| 639 | struct bitcoin_outpoint *outpoint, |
| 640 | struct bitcoin_txid *txid, |
| 641 | u32 tx_blockheight) |
| 642 | { |
| 643 | struct utxo *utxo; |
| 644 | |
| 645 | /* Find the amount this was for */ |
| 646 | utxo = wallet_utxo_get(tmpctx, ld->wallet, outpoint); |
| 647 | if (!utxo) { |
| 648 | log_broken(ld->log, "No record of utxo %s", |
| 649 | type_to_string(tmpctx, struct bitcoin_outpoint, |
| 650 | outpoint)); |
| 651 | return; |
| 652 | } |
| 653 | |
| 654 | notify_chain_mvt(ld, new_coin_wallet_withdraw(tmpctx, txid, outpoint, |
| 655 | tx_blockheight, |
| 656 | utxo->amount, WITHDRAWAL)); |
| 657 | } |
| 658 | |
| 659 | /** |
| 660 | * topo_update_spends -- Tell the wallet about all spent outpoints |
no test coverage detected