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

Function wallet_new

wallet/wallet.c:206–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206struct wallet *wallet_new(struct lightningd *ld, struct timers *timers)
207{
208 struct wallet *wallet = tal(ld, struct wallet);
209 wallet->ld = ld;
210 wallet->log = new_logger(wallet, ld->log_book, NULL, "wallet");
211 wallet->keyscan_gap = 50;
212 trace_span_start("db_setup", wallet);
213 wallet->db = db_setup(wallet, ld, ld->bip32_base);
214 trace_span_end(wallet);
215
216 db_begin_transaction(wallet->db);
217
218 trace_span_start("load_indexes", wallet);
219 load_indexes(wallet->db, ld->indexes);
220 trace_span_end(wallet);
221
222 trace_span_start("invoices_new", wallet);
223 wallet->invoices = invoices_new(wallet, wallet, timers);
224 trace_span_end(wallet);
225
226 trace_span_start("outpointfilters_init", wallet);
227 outpointfilters_init(wallet);
228 trace_span_end(wallet);
229
230 trace_span_start("our_addresses_init", wallet);
231 our_addresses_init(wallet);
232 trace_span_end(wallet);
233
234 db_commit_transaction(wallet->db);
235 return wallet;
236}
237
238/* Get id for move_accounts; create if necessary */
239static u64 move_accounts_id(struct db *db, const char *name, bool create)

Callers

nothing calls this directly

Calls 8

trace_span_endFunction · 0.85
load_indexesFunction · 0.85
outpointfilters_initFunction · 0.85
our_addresses_initFunction · 0.85
db_setupFunction · 0.70
invoices_newFunction · 0.70
new_loggerFunction · 0.50
db_commit_transactionFunction · 0.50

Tested by

no test coverage detected