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

Function wallet_utxoset_add

wallet/wallet.c:3858–3885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3856}
3857
3858void wallet_utxoset_add(struct wallet *w,
3859 const struct bitcoin_outpoint *outpoint,
3860 const u32 blockheight,
3861 const u32 txindex, const u8 *scriptpubkey,
3862 struct amount_sat sat)
3863{
3864 struct db_stmt *stmt;
3865
3866 stmt = db_prepare_v2(w->db, SQL("INSERT INTO utxoset ("
3867 " txid,"
3868 " outnum,"
3869 " blockheight,"
3870 " spendheight,"
3871 " txindex,"
3872 " scriptpubkey,"
3873 " satoshis"
3874 ") VALUES(?, ?, ?, ?, ?, ?, ?);"));
3875 db_bind_txid(stmt, 0, &outpoint->txid);
3876 db_bind_int(stmt, 1, outpoint->n);
3877 db_bind_int(stmt, 2, blockheight);
3878 db_bind_null(stmt, 3);
3879 db_bind_int(stmt, 4, txindex);
3880 db_bind_talarr(stmt, 5, scriptpubkey);
3881 db_bind_amount_sat(stmt, 6, &sat);
3882 db_exec_prepared_v2(take(stmt));
3883
3884 outpointfilter_add(w->utxoset_outpoints, outpoint);
3885}
3886
3887void wallet_filteredblock_add(struct wallet *w, const struct filteredblock *fb)
3888{

Callers 1

topo_add_utxosFunction · 0.85

Calls 7

db_bind_txidFunction · 0.85
db_bind_intFunction · 0.85
db_bind_nullFunction · 0.85
db_bind_talarrFunction · 0.85
db_bind_amount_satFunction · 0.85
db_exec_prepared_v2Function · 0.85
outpointfilter_addFunction · 0.70

Tested by

no test coverage detected