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

Function refill_outpointfilters

wallet/wallet.c:174–190  ·  view source on GitHub ↗

Idempotent: outpointfilter_add is a noop if it already exists. */

Source from the content-addressed store, hash-verified

172
173/* Idempotent: outpointfilter_add is a noop if it already exists. */
174static void refill_outpointfilters(struct wallet *w)
175{
176 struct db_stmt *stmt;
177
178 stmt = db_prepare_v2(
179 w->db,
180 SQL("SELECT txid, outnum FROM utxoset WHERE spendheight is NULL"));
181 db_query_prepared(stmt);
182
183 while (db_step(stmt)) {
184 struct bitcoin_outpoint outpoint;
185 db_col_txid(stmt, "txid", &outpoint.txid);
186 outpoint.n = db_col_int(stmt, "outnum");
187 outpointfilter_add(w->utxoset_outpoints, &outpoint);
188 }
189 tal_free(stmt);
190}
191
192static void outpointfilters_init(struct wallet *w)
193{

Callers 3

outpointfilters_initFunction · 0.85
wallet_block_removeFunction · 0.85
wallet_blocks_rollbackFunction · 0.85

Calls 6

db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_txidFunction · 0.85
db_col_intFunction · 0.85
tal_freeFunction · 0.85
outpointfilter_addFunction · 0.70

Tested by

no test coverage detected