Skip to content

Commit 31c74f2

Browse files
authored
Merge pull request #9962 from yyforyongyu/fix-panic
chainio: use package logger instead of instance logger
2 parents 79294df + b0aa4ae commit 31c74f2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

chainio/dispatcher.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ func (b *BlockbeatDispatcher) Stop() {
135135
}
136136

137137
func (b *BlockbeatDispatcher) log() btclog.Logger {
138+
// There's no guarantee that the `b.beat` is initialized when the
139+
// dispatcher shuts down, especially in the case where the node is
140+
// running as a remote signer, which doesn't have a chainbackend. In
141+
// that case we will use the package logger.
142+
if b.beat == nil {
143+
return clog
144+
}
145+
138146
return b.beat.logger()
139147
}
140148

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
- [Fixed](https://github.com/lightningnetwork/lnd/pull/9921) a case where the
2727
spending notification of an output may be missed if wrong height hint is used.
2828

29+
- [Fixed](https://github.com/lightningnetwork/lnd/pull/9962) a case where the
30+
node may panic if it's running in the remote signer mode.
31+
2932
# New Features
3033

3134
## Functional Enhancements

0 commit comments

Comments
 (0)