From 93bede938e2316ff46484073e068d6065e355de9 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 7 Jul 2025 15:40:45 +0300 Subject: [PATCH 1/2] contractcourt: only close quit in `Stop` Make sure we don't prematurely close the `quit` chans. --- contractcourt/utxonursery.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contractcourt/utxonursery.go b/contractcourt/utxonursery.go index f78be9fa4..f87524305 100644 --- a/contractcourt/utxonursery.go +++ b/contractcourt/utxonursery.go @@ -286,19 +286,18 @@ func (u *UtxoNursery) Start() error { // 2. Restart spend ntfns for any preschool outputs, which are waiting // for the force closed commitment txn to confirm, or any second-layer // HTLC success transactions. - // - // NOTE: The next two steps *may* spawn go routines, thus from this - // point forward, we must close the nursery's quit channel if we detect - // any failures during startup to ensure they terminate. + // NOTE: The next two steps *may* spawn go routines. if err := u.reloadPreschool(); err != nil { - close(u.quit) + utxnLog.Errorf("Failed to reload preschool: %v", err) + return err } // 3. Replay all crib and kindergarten outputs up to the current best // height. if err := u.reloadClasses(uint32(bestHeight)); err != nil { - close(u.quit) + utxnLog.Errorf("Failed to reload class: %v", err) + return err } @@ -309,7 +308,8 @@ func (u *UtxoNursery) Start() error { Hash: bestHash, }) if err != nil { - close(u.quit) + utxnLog.Errorf("RegisterBlockEpochNtfn failed: %v", err) + return err } From 8fe0d0f7cd93d11375ff0098ac894049351d7c22 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 7 Jul 2025 16:01:04 +0300 Subject: [PATCH 2/2] docs: update release docs --- docs/release-notes/release-notes-0.19.2.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/release-notes/release-notes-0.19.2.md b/docs/release-notes/release-notes-0.19.2.md index fd7a728f9..c8c9adffb 100644 --- a/docs/release-notes/release-notes-0.19.2.md +++ b/docs/release-notes/release-notes-0.19.2.md @@ -42,6 +42,9 @@ - [Fixed](https://github.com/lightningnetwork/lnd/pull/10035) a deadlock (writer starvation) in the switch. +- Fixed a [case](https://github.com/lightningnetwork/lnd/pull/10045) that a + panic may happen which prevents the node from starting up. + # New Features ## Functional Enhancements