* topo_update_spends -- Tell the wallet about all spent outpoints */
| 660 | * topo_update_spends -- Tell the wallet about all spent outpoints |
| 661 | */ |
| 662 | static void topo_update_spends(struct chain_topology *topo, struct block *b) |
| 663 | { |
| 664 | const struct short_channel_id *spent_scids; |
| 665 | for (size_t i = 0; i < tal_count(b->full_txs); i++) { |
| 666 | const struct bitcoin_tx *tx = b->full_txs[i]; |
| 667 | |
| 668 | for (size_t j = 0; j < tx->wtx->num_inputs; j++) { |
| 669 | struct bitcoin_outpoint outpoint; |
| 670 | |
| 671 | bitcoin_tx_input_get_outpoint(tx, j, &outpoint); |
| 672 | |
| 673 | if (wallet_outpoint_spend(topo->ld->wallet, tmpctx, |
| 674 | b->height, &outpoint)) |
| 675 | record_wallet_spend(topo->ld, &outpoint, |
| 676 | &b->txids[i], b->height); |
| 677 | |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | /* Retrieve all potential channel closes from the UTXO set and |
| 682 | * tell gossipd about them. */ |
| 683 | spent_scids = |
| 684 | wallet_utxoset_get_spent(tmpctx, topo->ld->wallet, b->height); |
| 685 | gossipd_notify_spends(topo->bitcoind->ld, b->height, spent_scids); |
| 686 | } |
| 687 | |
| 688 | static void topo_add_utxos(struct chain_topology *topo, struct block *b) |
| 689 | { |
no test coverage detected