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

Function wallet_new

wallet/wallet.c:92–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92struct wallet *wallet_new(struct lightningd *ld, struct timers *timers,
93 struct ext_key *bip32_base STEALS)
94{
95 struct wallet *wallet = tal(ld, struct wallet);
96 wallet->ld = ld;
97 wallet->log = new_log(wallet, ld->log_book, NULL, "wallet");
98 wallet->bip32_base = tal_steal(wallet, bip32_base);
99 wallet->keyscan_gap = 50;
100 list_head_init(&wallet->unstored_payments);
101 wallet->db = db_setup(wallet, ld, wallet->bip32_base);
102
103 db_begin_transaction(wallet->db);
104 wallet->invoices = invoices_new(wallet, wallet->db, timers);
105 outpointfilters_init(wallet);
106 db_commit_transaction(wallet->db);
107 return wallet;
108}
109
110/**
111 * wallet_add_utxo - Register an UTXO which we (partially) own

Callers

nothing calls this directly

Calls 6

list_head_initFunction · 0.85
outpointfilters_initFunction · 0.85
db_setupFunction · 0.70
invoices_newFunction · 0.70
new_logFunction · 0.50
db_commit_transactionFunction · 0.50

Tested by

no test coverage detected