Skip to content

Commit b815109

Browse files
authored
Merge pull request #10045 from yyforyongyu/fix-panic
contractcourt: only close quit in `Stop`
2 parents ff32e90 + 9fb0f77 commit b815109

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

contractcourt/utxonursery.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,19 +286,18 @@ func (u *UtxoNursery) Start() error {
286286
// 2. Restart spend ntfns for any preschool outputs, which are waiting
287287
// for the force closed commitment txn to confirm, or any second-layer
288288
// HTLC success transactions.
289-
//
290-
// NOTE: The next two steps *may* spawn go routines, thus from this
291-
// point forward, we must close the nursery's quit channel if we detect
292-
// any failures during startup to ensure they terminate.
289+
// NOTE: The next two steps *may* spawn go routines.
293290
if err := u.reloadPreschool(); err != nil {
294-
close(u.quit)
291+
utxnLog.Errorf("Failed to reload preschool: %v", err)
292+
295293
return err
296294
}
297295

298296
// 3. Replay all crib and kindergarten outputs up to the current best
299297
// height.
300298
if err := u.reloadClasses(uint32(bestHeight)); err != nil {
301-
close(u.quit)
299+
utxnLog.Errorf("Failed to reload class: %v", err)
300+
302301
return err
303302
}
304303

@@ -309,7 +308,8 @@ func (u *UtxoNursery) Start() error {
309308
Hash: bestHash,
310309
})
311310
if err != nil {
312-
close(u.quit)
311+
utxnLog.Errorf("RegisterBlockEpochNtfn failed: %v", err)
312+
313313
return err
314314
}
315315

docs/release-notes/release-notes-0.19.2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939

4040
- [Fixed](https://github.com/lightningnetwork/lnd/pull/10035) a deadlock (writer starvation) in the switch.
4141

42+
- Fixed a [case](https://github.com/lightningnetwork/lnd/pull/10045) that a
43+
panic may happen which prevents the node from starting up.
44+
4245
# New Features
4346

4447
## Functional Enhancements

0 commit comments

Comments
 (0)