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

Function wallet_set_blacklist

wallet/wallet.c:6725–6738  ·  view source on GitHub ↗

Hardly a common operation! Delete and rewrite entire table */

Source from the content-addressed store, hash-verified

6723
6724/* Hardly a common operation! Delete and rewrite entire table */
6725void wallet_set_blacklist(struct wallet *wallet, const struct rune_blacklist *blist)
6726{
6727 struct db_stmt *stmt;
6728 stmt = db_prepare_v2(wallet->db, SQL("DELETE FROM runes_blacklist"));
6729 db_exec_prepared_v2(take(stmt));
6730
6731 for (size_t i = 0; i < tal_count(blist); i++) {
6732 stmt = db_prepare_v2(wallet->db,
6733 SQL("INSERT INTO runes_blacklist VALUES (?,?)"));
6734 db_bind_u64(stmt, blist[i].start);
6735 db_bind_u64(stmt, blist[i].end);
6736 db_exec_prepared_v2(take(stmt));
6737 }
6738}
6739
6740void migrate_datastore_commando_runes(struct lightningd *ld, struct db *db)
6741{

Callers 1

json_blacklistruneFunction · 0.85

Calls 2

db_exec_prepared_v2Function · 0.85
db_bind_u64Function · 0.85

Tested by

no test coverage detected