MCPcopy Create free account
hub / github.com/ElementsProject/lightning / record_wallet_spend

Function record_wallet_spend

lightningd/chaintopology.c:638–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636}
637
638static 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

Callers 1

topo_update_spendsFunction · 0.85

Calls 4

wallet_utxo_getFunction · 0.85
new_coin_wallet_withdrawFunction · 0.85
notify_chain_mvtFunction · 0.70
type_to_stringClass · 0.50

Tested by

no test coverage detected