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

Function migrate_runes_idfix

wallet/wallet.c:6750–6769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6748}
6749
6750void migrate_runes_idfix(struct lightningd *ld, struct db *db)
6751{
6752 /* ID fields were wrong. Pull them all out and put them back */
6753 const char **runes = db_get_runes(tmpctx, db);
6754 struct db_stmt *stmt;
6755
6756 stmt = db_prepare_v2(db, SQL("DELETE FROM runes;"));
6757 db_exec_prepared_v2(stmt);
6758 tal_free(stmt);
6759
6760 for (size_t i = 0; i < tal_count(runes); i++) {
6761 struct rune *r;
6762
6763 r = rune_from_base64(tmpctx, runes[i]);
6764 if (!r)
6765 db_fatal(db, "Invalid databse rune %s", runes[i]);
6766
6767 db_rune_insert(db, r);
6768 }
6769}
6770
6771void wallet_set_local_anchor(struct wallet *w,
6772 u64 channel_id,

Callers

nothing calls this directly

Calls 6

db_get_runesFunction · 0.85
db_exec_prepared_v2Function · 0.85
tal_freeFunction · 0.85
rune_from_base64Function · 0.85
db_fatalFunction · 0.85
db_rune_insertFunction · 0.85

Tested by

no test coverage detected