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

Function wallet_save_chain_mvt

wallet/wallet.c:7110–7126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7108}
7109
7110void wallet_save_chain_mvt(struct lightningd *ld,
7111 const struct chain_coin_mvt *chain_mvt)
7112{
7113 u64 id;
7114
7115 /* On restart, we do chain replay. For this (and other
7116 * reorgs) we need to de-duplicate here. The other db tables
7117 * do this by deleting old entries on reorg, but we never
7118 * delete. */
7119 if (is_duplicate(ld->wallet->db, chain_mvt))
7120 goto out;
7121
7122 id = insert_chain_mvt(ld, ld->wallet->db, chain_mvt);
7123 notify_chain_mvt(ld, chain_mvt, id);
7124out:
7125 tal_free_if_taken(chain_mvt);
7126}
7127
7128static void db_cols_account(struct db_stmt *stmt,
7129 struct lightningd *ld,

Callers 10

got_utxoFunction · 0.85
mainFunction · 0.85
record_wallet_spendFunction · 0.85
onchain_add_utxoFunction · 0.85
json_injectutxodepositFunction · 0.85
json_injectutxospendFunction · 0.85
channel_record_spliceFunction · 0.85
channel_record_openFunction · 0.85

Calls 4

is_duplicateFunction · 0.85
insert_chain_mvtFunction · 0.85
tal_free_if_takenFunction · 0.85
notify_chain_mvtFunction · 0.50

Tested by 1

mainFunction · 0.68