diff --git a/wallet/test/Makefile b/wallet/test/Makefile index c1df83063..2f5952967 100644 --- a/wallet/test/Makefile +++ b/wallet/test/Makefile @@ -21,7 +21,7 @@ WALLET_TEST_COMMON_OBJS := \ common/node_id.o \ common/onionreply.o \ common/key_derive.o \ - common/psbt_keypath.o \ + common/psbt_keypath.o \ common/pseudorand.o \ common/setup.o \ common/timeout.o \ diff --git a/wallet/test/run-db.c b/wallet/test/run-db.c index e368a7aaa..ad8d84eac 100644 --- a/wallet/test/run-db.c +++ b/wallet/test/run-db.c @@ -244,6 +244,12 @@ u8 *towire_hsmd_get_output_scriptpubkey(const tal_t *ctx UNNEEDED, u64 channel_i /* Generated stub for towire_temporary_node_failure */ u8 *towire_temporary_node_failure(const tal_t *ctx UNNEEDED) { fprintf(stderr, "towire_temporary_node_failure called!\n"); abort(); } +/* Generated stub for trace_span_end */ +void trace_span_end(const void *key UNNEEDED) +{ fprintf(stderr, "trace_span_end called!\n"); abort(); } +/* Generated stub for trace_span_start */ +void trace_span_start(const char *name UNNEEDED, const void *key UNNEEDED) +{ fprintf(stderr, "trace_span_start called!\n"); abort(); } /* Generated stub for txfilter_add_scriptpubkey */ void txfilter_add_scriptpubkey(struct txfilter *filter UNNEEDED, const u8 *script TAKES UNNEEDED) { fprintf(stderr, "txfilter_add_scriptpubkey called!\n"); abort(); } diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index c06e7222c..68693ecf9 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -856,6 +856,12 @@ u8 *towire_warningfmt(const tal_t *ctx UNNEEDED, const struct channel_id *channel UNNEEDED, const char *fmt UNNEEDED, ...) { fprintf(stderr, "towire_warningfmt called!\n"); abort(); } +/* Generated stub for trace_span_end */ +void trace_span_end(const void *key UNNEEDED) +{ fprintf(stderr, "trace_span_end called!\n"); abort(); } +/* Generated stub for trace_span_start */ +void trace_span_start(const char *name UNNEEDED, const void *key UNNEEDED) +{ fprintf(stderr, "trace_span_start called!\n"); abort(); } /* Generated stub for try_reconnect */ void try_reconnect(const tal_t *ctx UNNEEDED, struct peer *peer UNNEEDED, diff --git a/wallet/wallet.c b/wallet/wallet.c index 5bc92fe10..3ef28d9ec 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -110,12 +111,21 @@ struct wallet *wallet_new(struct lightningd *ld, struct timers *timers) wallet->log = new_logger(wallet, ld->log_book, NULL, "wallet"); wallet->keyscan_gap = 50; list_head_init(&wallet->unstored_payments); + trace_span_start("db_setup", wallet); wallet->db = db_setup(wallet, ld, ld->bip32_base); + trace_span_end(wallet); db_begin_transaction(wallet->db); + + trace_span_start("invoices_new", wallet); wallet->invoices = invoices_new(wallet, wallet, timers); + trace_span_end(wallet); + + trace_span_start("outpointfilters_init", wallet); outpointfilters_init(wallet); load_indexes(wallet->db, ld->indexes); + trace_span_end(wallet); + db_commit_transaction(wallet->db); return wallet; }