mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
lightningd: fix crash on startup expirations.
The wait code assumes ld->wallet is populated, but it's not. Start the expiration cycle later. ``` 0x7f271a18d08f ??? /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x5581a27dc082 wait_index_increment lightningd/wait.c:112 0x5581a27e331a invoice_index_inc wallet/invoices.c:738 0x5581a27e3dfe invoice_index_update_status wallet/invoices.c:775 0x5581a27e3ea3 trigger_expiration wallet/invoices.c:185 0x5581a27e3f47 invoices_new wallet/invoices.c:134 0x5581a27e8a2c wallet_new wallet/wallet.c:121 0x5581a27b08b5 main lightningd/lightningd.c:1082 ``` Fixes: #6457 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -77,6 +77,7 @@
|
||||
#include <lightningd/runes.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <wallet/invoices.h>
|
||||
#include <wallet/txfilter.h>
|
||||
#include <wally_bip32.h>
|
||||
|
||||
@@ -1192,6 +1193,9 @@ int main(int argc, char *argv[])
|
||||
/*~ Finish our runes initialization (includes reading from db) */
|
||||
runes_finish_init(ld->runes);
|
||||
|
||||
/*~ Start expiring old invoices now ld->wallet is set.*/
|
||||
invoices_start_expiration(ld);
|
||||
|
||||
/*~ That's all of the wallet db operations for now. */
|
||||
db_commit_transaction(ld->wallet->db);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user